@Test public void allPossibleExpansionsForThreeNodes() { MapNode<Integer, String> rightGrandchild = MapNode.create("d", ImmutableMap.<Integer, MapNode<Integer, String>>of()); MapNode<Integer, String> rightChild = MapNode.create("c", ImmutableMap.<Integer, MapNode<Integer, String>>of(2, rightGrandchild)); MapNode<Integer, String> leftChild = MapNode.create("b", ImmutableMap.<Integer, MapNode<Integer, String>>of()); MapNode<Integer, String> root = MapNode.create( "a", ImmutableMap.<Integer, MapNode<Integer, String>>of(0, leftChild, 1, rightChild)); Assert.assertTrue(allPossibleExpansions(root, 0).isEmpty()); MoreAsserts.assertContentsAnyOrder(allPossibleExpansions(root, 1), ImmutableList.of(root)); MoreAsserts.assertContentsAnyOrder(allPossibleExpansions(root, 2), ImmutableList.of(root)); MoreAsserts.assertContentsAnyOrder(toIdentitySetList(allPossibleExpansions(root, 3)), toIdentitySet(ImmutableList.of(root)), toIdentitySet(ImmutableList.of(root, leftChild, rightChild))); List<Set<MapNode<Integer, String>>> actual = toIdentitySetList(allPossibleExpansions(root, 4)); MoreAsserts.assertContentsAnyOrder(actual, toIdentitySet(ImmutableList.of(root)), toIdentitySet(ImmutableList.of(root, leftChild, rightChild)), toIdentitySet(ImmutableList.of(root, leftChild, rightChild, rightGrandchild))); }
public static <K, V extends AdditiveValue<V>> BoundedRollup<K, V> create( V emptyValue, int maxNodes) { return new BoundedRollup<K, V>(maxNodes); }
BoundedRollup implements StreamingRollup<K, V> { public static <K, V extends AdditiveValue<V>> BoundedRollup<K, V> create( V emptyValue, int maxNodes) { return new BoundedRollup<K, V>(maxNodes); } }
BoundedRollup implements StreamingRollup<K, V> { public static <K, V extends AdditiveValue<V>> BoundedRollup<K, V> create( V emptyValue, int maxNodes) { return new BoundedRollup<K, V>(maxNodes); } private  BoundedRollup(int maxNodes); }
BoundedRollup implements StreamingRollup<K, V> { public static <K, V extends AdditiveValue<V>> BoundedRollup<K, V> create( V emptyValue, int maxNodes) { return new BoundedRollup<K, V>(maxNodes); } private  BoundedRollup(int maxNodes); static BoundedRollup<K, V> create(
      V emptyValue, int maxNodes); @Override void feedRow(Iterator<K> leafPath, V v); @Override MapNode<K, V> finish(); @Override String toString(); }
BoundedRollup implements StreamingRollup<K, V> { public static <K, V extends AdditiveValue<V>> BoundedRollup<K, V> create( V emptyValue, int maxNodes) { return new BoundedRollup<K, V>(maxNodes); } private  BoundedRollup(int maxNodes); static BoundedRollup<K, V> create(
      V emptyValue, int maxNodes); @Override void feedRow(Iterator<K> leafPath, V v); @Override MapNode<K, V> finish(); @Override String toString();  }