2
* Static ITD of a generic method
9
public class StaticGenericMethodITD {
10
public static void main(String[] argv) {
11
List<Integer> ints = new ArrayList<Integer>();
12
ints.add(10); ints.add(20); ints.add(30);
13
System.err.println("First="+MathUtils.first(ints));
14
if (!MathUtils.first(ints).equals(10))
15
throw new RuntimeException("First val!=10, it was "+
16
MathUtils.first(ints));
22
static <E> E MathUtils.first(List<E> elements) { return elements.get(0); }