Method to sum all the values

Write a method that will sum all the values , which are divisible by 7, of a stack of Integers without changing the stack. This function will return the sum. (Hint: You may use a temp stack if necessary.) Use following method signature:
public static int sumpos(ArrayBoundedStack stack)