public <T> List<T> reverse(List<T> list) {
        /*
        Algorithm:
            1. Maintain a stack
            2. Iterate over all the elements in a list and put that on the stack
            3. Then empty the stack into a new LinkedList
         */
        Stack<T> stack = new Stack<>();
        list.forEach(stack::push);
        List<T> reversed = new LinkedList<>();
        while (!stack.isEmpty()) {
            reversed.add(stack.pop());
        }
        return reversed;
    }
Write a program to reverse the direction of a given singly-linked list.
In other words, after the reversal all pointers should now point backwards.
Your algorithm should take linear time.
java8/src/main/java/com/shekhargulati/tadm/ch03/Problem3_2.java