Java tutorial
//package com.java2s; import java.util.Collection; public class Main { public static boolean isSameCollection(Collection<?> newCollection, Collection<?> oldCollection) { if (newCollection == null || newCollection.isEmpty()) { return true; } else if (oldCollection != null) { if (newCollection.containsAll(oldCollection) && oldCollection.containsAll(newCollection)) { return true; } else { return false; } } return false; } public static boolean isEmpty(Collection<?> collection) { return collection == null || collection.size() == 0; } public static boolean isEmpty(String[] array) { return array == null || array.length == 0; } }