Write a Java method which returns the stack element at a given index. Please send your responses to techinterview@firstmeta.com All of the following requirements must be met. - If the index is out of range, an Exception must be thrown (any Exception will do). - The stack object passed into the method must remain unmodified upon return ( even if an Exception was thrown ) - Only use a subset of the push(), pop(), empty(), and peek() methods on the Stack. - Bonus points for using as few of the above methods as possible. - Bonus points for terseness of your program. - Do not define any other methods. - Do not create any other objects in the method, including Strings and arrays; use only primitive types Method signature: int getStackElement( Stack stack, int index ) throws Exception stack -- stack object, should be unchanged upon return index -- 0-based index of element to return counting from the top of the stack Example: Stack stack = new Stack(); stack.push(10); stack.push(20); stack.push(30); stack.push(40); stack.push(50); stack.push(60); getStackElement(stack, 2); // returns 40 getStackElement(stack, 6); // throws an exception