@Test void testGetFirstOrNullWithNull() { assertNull(CollectionUtil.getFirstOrNull(null), "Calling with null should result in null"); assertNull(CollectionUtil.getFirstOrNull(Collections.emptyList()), "Calling with an empty list shall result in null"); }
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);  }