@Test void testGetFirstOrNull() { List<String> strings = Arrays.asList("1", "2", "3"); assertEquals("1", CollectionUtil.getFirstOrNull(strings), "Calling with an list should result in the first element"); }
public static <T> T getFirstOrNull(List<T> list) { if (list == null || list.isEmpty()) { return null; } return list.get(0); }
CollectionUtil { public static <T> T getFirstOrNull(List<T> list) { if (list == null || list.isEmpty()) { return null; } return list.get(0); } }
CollectionUtil { public static <T> T getFirstOrNull(List<T> list) { if (list == null || list.isEmpty()) { return null; } return list.get(0); } private  CollectionUtil(); }
CollectionUtil { public static <T> T getFirstOrNull(List<T> list) { if (list == null || list.isEmpty()) { return null; } return list.get(0); } private  CollectionUtil(); static T getFirstOrNull(List<T> list); static Map<K, V> asHashMap(List<V> list, ListExtractor<K, V> extractor); }
CollectionUtil { public static <T> T getFirstOrNull(List<T> list) { if (list == null || list.isEmpty()) { return null; } return list.get(0); } private  CollectionUtil(); static T getFirstOrNull(List<T> list); static Map<K, V> asHashMap(List<V> list, ListExtractor<K, V> extractor);  }