TreeID extends LongWritable implements Cloneable { public TreeID() { } TreeID();  TreeID(int partition, int treeId); void set(int partition, int treeId); int partition(); int treeId(); @Override TreeID clone(); static final int MAX_TREEID; }
@Test public void testTreeID() { Random rng = RandomUtils.getRandom(); for (int nloop = 0; nloop < 1000000; nloop++) { int partition = Math.abs(rng.nextInt()); int treeId = rng.nextInt(TreeID.MAX_TREEID); TreeID t1 = new TreeID(partition, treeId); assertEquals(partition, t1.partition()); assertEquals(treeId, t1.treeId()); TreeID t2 = new TreeID(); t2.set(partition, treeId); assertEquals(partition, t2.partition()); assertEquals(treeId, t2.treeId()); } }