Android examples for java.util:Collection
deep Equals between two Collection
// Copyright (c) 2003-2013, LogMeIn, Inc. All rights reserved. import java.util.Collection; public class Main{ public static void main(String[] argv){ Collection one = java.util.Arrays.asList("asdf","book2s.com"); Collection two = java.util.Arrays.asList("asdf","book2s.com"); System.out.println(deepEquals(one,two)); }/*from w w w . j av a 2 s.co m*/ public static <T extends Object> boolean deepEquals(Collection<T> one, Collection<T> two) { if (ObjectUtil.nullCheckEquals(one, two)) { return true; } if (one == null || two == null) { return false; } if (one.size() != two.size()) { return false; } if (one.containsAll(two)) { return true; } return false; } }