@Test public void shouldReturnListWhenNotNull()throws Exception{ List<String> strings = asList("string"); List<String> response = emptyIfNull(strings); assertThat(response, is(strings)); }
public static <T> List<T> emptyIfNull(List<T> list) { if (list == null) { return Collections.emptyList(); } return list; }
ListUtil { public static <T> List<T> emptyIfNull(List<T> list) { if (list == null) { return Collections.emptyList(); } return list; } }
ListUtil { public static <T> List<T> emptyIfNull(List<T> list) { if (list == null) { return Collections.emptyList(); } return list; } private  ListUtil(); }
ListUtil { public static <T> List<T> emptyIfNull(List<T> list) { if (list == null) { return Collections.emptyList(); } return list; } private  ListUtil(); static List<T> emptyIfNull(List<T> list); }
ListUtil { public static <T> List<T> emptyIfNull(List<T> list) { if (list == null) { return Collections.emptyList(); } return list; } private  ListUtil(); static List<T> emptyIfNull(List<T> list);  }