import java.util.ArrayList; public class Example1 { public T get(ArrayList t) throws T { return t.get(0); } public static void main(String[] args) { Example1 e = new Example1<>(); ArrayList al = new ArrayList<>(); al.add(new Exception("Exception Thrown")); try { System.out.println(e.get(al)); } catch (Exception exception) { exception.printStackTrace(); } } }