Java List First Item prepend(String first, List list)

Here you can find the source of prepend(String first, List list)

Description

prepend

License

Apache License

Declaration

public static List<String> prepend(String first, List<String> list) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Main {
    public static List<String> prepend(String first, List<String> list) {
        return merge(Arrays.asList(first), list);
    }/*from   www .ja  v  a 2 s  . co m*/

    public static List<String> merge(List<String> first, List<String> second) {
        ArrayList<String> result = new ArrayList<String>(first);
        result.addAll(second);
        return result;
    }
}

Related

  1. moveItemKindInFirst(final List list)
  2. nullSafeAppend(List first, List second)
  3. orderByFirstOccurenceInText(String listToOrder[], String textToParse, boolean fuzzy)
  4. orderByFuzzyFirstOccurenceInText(String listToOrder[], String textToParse)
  5. permutationsWithFirstElement(List listings)
  6. putFirstLast(List list)
  7. removeFirst(final List list)
  8. removeFirst(List list)
  9. removeFirst(List list)