/** * Test method for {@link * com.easy.common.collections.CollectionHelper#containsAny(java.util.Collection, * java.util.Collection)} . */ @Test public void testContainsAny() { list.add("1"); list.add("2"); list2.add("1"); list2.add("4"); Assert.assertTrue(CollectionHelper.containsAny(list, list2)); list2.remove("1"); Assert.assertFalse(CollectionHelper.containsAny(list, list2)); }
/** * Test method for {@link * com.easy.common.collections.CollectionHelper#subtract(java.util.Collection, * java.util.Collection)} . */ @Test public void testSubtract() { list.add("1"); list.add("2"); list2.add("2"); Assert.assertEquals(1, CollectionHelper.subtract(list, list2).size()); }
/** * Test method for {@link com.easy.common.collections.CollectionHelper#union(java.util.Collection, * java.util.Collection)} . */ @Test public void testUnion() { list.add("1"); list.add("2"); list2.add("3"); list2.add("4"); Assert.assertEquals(4, CollectionHelper.union(list, list2).size()); }
/** * Test method for {@link * com.easy.common.collections.CollectionHelper#isEqual(java.util.Collection, * java.util.Collection)} . */ @Test public void testIsEqual() { list.add("1"); list.add("2"); list2.add("1"); list2.add("2"); Assert.assertTrue(CollectionHelper.isEqual(list, list2)); }
/** Test method for {@link com.easy.common.collections.CollectionHelper#size(K[])}. */ @Test public void testSizeKArray() { Assert.assertEquals(4, CollectionHelper.size(1, 2, 3, 4)); }
/** * Test method for {@link com.easy.common.collections.CollectionHelper#last(java.util.Collection)} * . */ @Test public void testLastCollectionOfQ() { list.add("1"); list.add("2"); Assert.assertEquals("2", CollectionHelper.last(list)); }
/** * Test method for {@link * com.easy.common.collections.CollectionHelper#isEmpty(java.util.Collection)} . */ @Test public void testIsEmpty() { Assert.assertTrue(CollectionHelper.isEmpty(list)); }
/** * Test method for {@link * com.easy.common.collections.CollectionHelper#isNotBlank(java.util.Collection)} . */ @Test public void testIsNotBlank() { Assert.assertFalse(CollectionHelper.isNotBlank(list)); }