Package com.identity4j.util
Class CollectionUtil
- java.lang.Object
-
- com.identity4j.util.CollectionUtil
-
public class CollectionUtil extends Object
Provides general purpose Collection utilities.
-
-
Constructor Summary
Constructors Constructor Description CollectionUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Iterator<T>emptyIterator(Class<T> klass)Provides empty iterator for the provided type of klass
Note: Java 7 provides emptyIterator implementation.static <T> Collection<T>objectsNotPresentInProbeCollection(Collection<T> providedCollection, Collection<T> probeCollection)Utility function which scans the providedCollection and returns elements not present in probeCollection Collection 1 -- 1,2,9,5 Collection 2 -- 3,1,5,8 Result -- 2,9
-
-
-
Method Detail
-
objectsNotPresentInProbeCollection
public static <T> Collection<T> objectsNotPresentInProbeCollection(Collection<T> providedCollection, Collection<T> probeCollection)
Utility function which scans the providedCollection and returns elements not present in probeCollection Collection 1 -- 1,2,9,5 Collection 2 -- 3,1,5,8 Result -- 2,9- Parameters:
providedCollection-probeCollection-- Returns:
- elements not found in probeCollection
-
-