Comparing unordered list in java
I think it would be better to not convert the List to a Set, but just check if they are the same size and if one contains all of the other (as it is done in HashSet) like so:

public static boolean test(Object o1, Object o2){
    try{
        Collection&lt;?&gt; c1 = (Collection&lt;?&gt;)o1,
                      c2 = (Collection&lt;?&gt;)o2;
        return (c1.size()==c2.size())&amp;&amp;c1.containsAll(c2);
    }
    catch(Exception e){
        return false;
    }
}