java 8 create list with elements code example Example: list java initialize List<MyType> myList = new ArrayList<MyType>();