DataUtils { public static <E> List<Item> getEnumItems(Class<E> clazz) { return getEnumItems(clazz, true); }  static List<Item> getEnumItems(Class<E> clazz); static List<Item> getEnumItems(Class<E> clazz, boolean withNull); static List<Item> getBooleanItems(); static List<Item> toItems(List<E> listIn); static Item toItem(E item); static List<Item> getMonthItems(); static List<Item> getMonthItems(boolean withNull); static List<Item> toItems(List<E> listIn, boolean withNull); static List<Item> addEmptyItem(List<Item> items); static List<Item> addItems(List<Item> items, List<E> listIn); static void updateListOfDays(ControlSpinnerField birthdateDD, Integer selectedYear, Integer selectedMonth);  }
@Test public void getEnumItems() { List<Item> enumItems = DataUtils.getEnumItems(YesNoUnknown.class, true); assertThat(enumItems.size(), is(YesNoUnknown.values().length + 1)); enumItems = DataUtils.getEnumItems(YesNoUnknown.class, false); assertThat(enumItems.size(), is(YesNoUnknown.values().length)); }
@Test(expected = IllegalArgumentException.class) public void getEnumItemsIllegalArgument() { DataUtils.getEnumItems(Object.class, false); }
@Test(expected = NullPointerException.class) public void getEnumItemsNullPointer() { DataUtils.getEnumItems(null, false); }