1 class CompositeObjects { 2 static class Node { 3 public Node _next; 4 public Node() {} 5 } 6 7 static Object _global; 8 9 public static void test() { 10 var a = new Node(); 11 var b = new Node(); 12 13 a._next = b; b._next = a; 14 blackhole(a); // materialize a here. 15 } 16 public static void blackhole(Object o) { 17 _global = o; 18 } 19 public static void main(String[] args ) { 20 for (int i=0; i < 100_000; ++i) { 21 test(); 22 } 23 } 24 }