// generics/TupleList.java // (c)2017 MindView LLC: see Copyright.txt // We make no guarantees that this code is fit for any purpose. // Visit http://OnJava8.com for more book information. // Combining generic types to make complex generic types import java.util.*; import onjava.*; import java.util.stream.*; public class TupleList extends ArrayList> { public static void main(String[] args) { TupleList tl = new TupleList<>(); tl.add(TupleTest2.h()); tl.add(TupleTest2.h()); tl.forEach(System.out::println); } } /* Output: (Vehicle@107d329, Amphibian@1629346, hi, 47) (Vehicle@4b9385, Amphibian@1311334, hi, 47) */