1 package test.java.semantics;
5 //hmmm: convert this to simple unit test.
12 public Object cogitate()
17 public static void main(String s[]) throws Exception
19 // we are just asserting that it is safe to do instanceof on an object that is null.
20 // let's test that theory.
21 instance_of tony = new instance_of();
22 Object fred = tony.cogitate(); // will produce null.
23 if (fred instanceof List<?>) {
24 throw new Exception("FAILURE! fred should not be instance of List<?> ! null is an instance of something!");
26 System.out.println("told us null is not an instance of List, which is correct.");