List of utility methods to do List First Item
List | addFirst(List add First list.add(0, values);
return list;
|
void | addFirstAndRemoveOldIfNeed(List add First And Remove Old If Need if (dest == null) { return; if (src == null || src.isEmpty()) { return; removeDuplicate(dest, src); dest.addAll(0, src); ... |
List | cons(P first, List extends P> list) cons List<P> builder = new ArrayList<>(list.size() + 1); builder.add(first); builder.addAll(list); return builder; |
boolean | equalLists(List> first, List> second) equal Lists if (first == null) { return second == null; } else if (second == null) { return first == null; if (first.size() == second.size()) { for (int i = 0; i < first.size(); i++) { if (!equalObjects(first.get(i), second.get(i))) { ... |
void | expectedOrder(List> src, Object first, Object second) expected Order int firstIndex = src.indexOf(first); int secondIndex = src.indexOf(second); if (firstIndex >= secondIndex) { throw new AssertionError("Wrong order for [" + first + ", " + second + "] in " + src); |
List | extractFirst(int numberToExtract, List extract First List<T> topList = new ArrayList<T>(); for (int i = 0; i < numberToExtract && i < list.size(); i++) { topList.add(list.get(i)); return topList; |
T | first(final List Gets the first element of the given list, or null if none. if (list == null || list.size() == 0) return null; return list.get(0); |
T | first(final List Returns the first ordinal element in the list. final int size = list.size() - 1; if (size >= oridinal) { return list.get(oridinal); return null; |
T | first(final List Returns first item in List . return t != null && !t.isEmpty() ? t.get(0) : null;
|
K | first(List first if (isNull(list)) { return null; return list.get(0); |