I have an array that is initialized like:
Element[] array = {new Element(1), new Element(2), new Element(3)};
I would like to convert this
Since Java 8 there is an easier way to transform:
import java.util.List; import static java.util.stream.Collectors.toList; public static List fromArray(T[] array) { return Arrays.stream(array).collect(toList()); }