Java Utililty Methods List First Item

List of utility methods to do List First Item

Description

The list of methods to do List First Item are organized into topic(s).

Method

booleanhasSameElement(List firstList, List secondList)
has Same Element
for (Integer element : firstList) {
    if (secondList.contains(element)) {
        return true;
return false;
booleanisFirst(List list, V object)
is First
V first = getFirst(list);
return first.equals(object);
booleanisFirstAnnotationOfMethod(List lines, int lineNumber)
is First Annotation Of Method
String line = lines.get(lineNumber);
if (isAnnotation(line) && (lineNumber == 0 || !isAnnotation(lines, lineNumber - 1))) {
    int i = lineNumber + 1;
    while (i < lines.size() && isAnnotation(lines.get(i))) {
        i++;
    return isMethodDeclaration(lines, i);
return false;
booleanisFirstPage(List pageLines, List> rawPages)
is First Page
return rawPages.indexOf(pageLines) == 0;
booleanisInOrder(List src, Object first, Object second)
is In Order
int firstIndex = src.indexOf(first);
int secondIndex = src.indexOf(second);
return firstIndex < secondIndex;
Listlimit(List list, Long firstResult, Long maxResults)
limit
return limit(list, firstResult != null ? firstResult.intValue() : null,
        maxResults != null ? maxResults.intValue() : null);
ListlistWith(Object aFirstObject)
list With
List list = new ArrayList();
list.add(aFirstObject);
return list;
Listmerge(List first, List second)
merge
ArrayList<String> result = new ArrayList<String>(first);
result.addAll(second);
return result;
ListmergeLists(List first, List second)
Merge two lists into a single list
if (first == null)
    return second;
else if (second == null)
    return first;
else {
    first.addAll(second);
    return first;
ListmergeLists(List first, List second)
merge Lists
List<E> merged = new ArrayList<E>(first);
for (E obj : second) {
    if (!merged.contains(obj))
        merged.add(obj);
return merged;