Map
assertTrue(EmptyUtils.isEmpty(emptyMap));
}
@Test
public static void testObjectArrayIsEmpty() {
Integer[] array = { 1, 2, 3 };
assertFalse(EmptyUtils.isEmpty(array));
Integer[] nullArray = null;
assertTrue(EmptyUtils.isEmpty(nullArray));
Integer[] emptyArray = {};
assertTrue(EmptyUtils.isEmpty(emptyArray));
}
@Test
public static void testCollectionNotEmpty() {
List
boolean listWithPositiveSize = EmptyUtils.notEmpty(list);
assertTrue(listWithPositiveSize);
List
boolean listWithZeroSize = EmptyUtils.notEmpty(emptyList);
assertFalse(listWithZeroSize);
List
boolean nullEmpty = EmptyUtils.notEmpty(nullList);
assertFalse(nullEmpty);
Set
set.add(100);
boolean setWithPositiveSize = EmptyUtils.notEmpty(set);
assertTrue(setWithPositiveSize);
Set
assertFalse(EmptyUtils.notEmpty(nullSet));
Set
assertFalse(EmptyUtils.notEmpty(emptySet));
}
@Test
public static void testMapNotEmpty() {
Map
map.put("mapTest", "mapTestValue");
assertTrue(EmptyUtils.notEmpty(map));
Map
assertFalse(EmptyUtils.notEmpty(nullEmpty));
Map
assertFalse(EmptyUtils.notEmpty(emptyMap));
}
@Test
public static void testObjectArrayNotEmpty() {
Integer[] array = { 1, 2, 3 };
assertTrue(EmptyUtils.notEmpty(array));
Integer[] nullArray = null;
assertFalse(EmptyUtils.notEmpty(nullArray));
Integer[] emptyArray = {};
assertFalse(EmptyUtils.notEmpty(emptyArray));
}
}