@@ -0,0 +1,1592 @@
+/*%0A * #%25L%0A * ImageJ interactive debugging tutorials.%0A * %25%25%0A * Copyright (C) 2009 - 2015 Board of Regents of the University of Wisconsin-Madison%0A * %25%25%0A * To the extent possible under law, the ImageJ developers have waived%0A * all copyright and related or neighboring rights to this tutorial code.%0A * %0A * See the CC0 1.0 Universal license for details:%0A * http://creativecommons.org/publicdomain/zero/1.0/%0A * #L%25%0A */%0A%0Apackage net.imagej.trouble.hidden;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.HashSet;%0Aimport java.util.List;%0Aimport java.util.Set;%0A%0A/**%0A * STOP LOOKING AT THIS CLASS!! IT'S OFF LIMITS!%0A *%0A * @author Mark Hiner %3Chinerm@gmail.com%3E%0A */%0Apublic class ObjectMaker %7B%0A%0A%09final static Set%3CObject%3E cache = new HashSet%3CObject%3E();%0A%0A%09public static List%3CObject%3E getList(final int size) %7B%0A%09%09final List%3CObject%3E list = new ArrayList%3CObject%3E();%0A%0A%09%09for (int i = 0; i %3C size - 1; i++) %7B%0A%09%09%09list.add(new Double(Math.random() * 100000));%0A%09%09%7D%0A%0A%09%09return list;%0A%09%7D%0A%0A%09public static Object%5B%5D getArray(final int size) %7B%0A%09%09final Object%5B%5D array = new Object%5Bsize%5D;%0A%0A%09%09for (int i = 0; i %3C size - 1; i++) %7B%0A%09%09%09array%5Bi%5D = new Double(Math.random() * 100000);%0A%09%09%7D%0A%0A%09%09array%5B(int) (Math.random() * (size - 1))%5D = null;%0A%0A%09%09return array;%0A%09%7D%0A%0A%09public static Double%5B%5D getDoubleArray(final int size) %7B%0A%09%09final Double%5B%5D array = new Double%5Bsize%5D;%0A%0A%09%09return array;%0A%09%7D%0A%0A%09public static Float%5B%5D getFloatArray(final int size) %7B%0A%09%09final Float%5B%5D array = new Float%5Bsize%5D;%0A%0A%09%09cache.add(array);%0A%0A%09%09return array;%0A%09%7D%0A%0A%09public static Long%5B%5D getLongArray(final int size) %7B%0A%09%09final Long%5B%5D array = new Long%5Bsize%5D;%0A%0A%09%09return array;%0A%09%7D%0A%7D%0A

Create ObjectMaker black box