Package org.fest.util

Class Lists

java.lang.Object
org.fest.util.Lists

public final class Lists extends Object
Utility methods related to java.util.Lists.
Author:
Yvonne Wang, Alex Ruiz, Joel Costigliola
  • Method Details

    • newArrayList

      public static <T> ArrayList<T> newArrayList(T... elements)
      Creates a mutable ArrayList containing the given elements.
      Type Parameters:
      T - the generic type of the ArrayList to create.
      Parameters:
      elements - the elements to store in the ArrayList.
      Returns:
      the created ArrayList, of null if the given array of elements is null.
    • newArrayList

      public static <T> ArrayList<T> newArrayList(Iterable<? extends T> elements)
      Creates a mutable ArrayList containing the given elements.
      Type Parameters:
      T - the generic type of the ArrayList to create.
      Parameters:
      elements - the elements to store in the ArrayList.
      Returns:
      the created ArrayList, of null if the given Iterable is null.