private boolean compare(List<Integer> l1, List<Integer> l2){
        Set<Integer> s = new HashSet<Integer>();
        for(Integer i : l1){
            s.add(i);
        }
        for(Integer i : l2){
            if(!s.contains(i)){
                return false;
            }
        }
        return true;
    }
It might not work for duplicate elements in array. For that you have to store
both index and actual value to differentiate somehow.
src/com/interview/tree/IdenticalTrees.java