@Test public void build_singleChain() { final SignedBeaconBlock baseBlock = dataStructureUtil.randomSignedBeaconBlock(0); final List<SignedBeaconBlock> descendants = dataStructureUtil.randomSignedBeaconBlockSequence(baseBlock, 5); final List<SignedBeaconBlock> chain = new ArrayList<>(); chain.add(baseBlock); chain.addAll(descendants); final HashTree blockTree = HashTree.builder().rootHash(baseBlock.getRoot()).block(baseBlock).blocks(chain).build(); validateTreeRepresentsChain(blockTree, chain); }
public static Builder builder() { return new Builder(); }
HashTree { public static Builder builder() { return new Builder(); } }
HashTree { public static Builder builder() { return new Builder(); } private  HashTree(
      final Bytes32 rootHash,
      final Map<Bytes32, Bytes32> childToParent,
      final Map<Bytes32, Set<Bytes32>> parentToChildren); }
HashTree { public static Builder builder() { return new Builder(); } private  HashTree(
      final Bytes32 rootHash,
      final Map<Bytes32, Bytes32> childToParent,
      final Map<Bytes32, Set<Bytes32>> parentToChildren); static Builder builder(); Builder updater(); Builder withRoot(final Bytes32 newRootHash); Bytes32 getRootHash(); Optional<Bytes32> getParent(final Bytes32 childRoot); Set<Bytes32> getAllRoots(); void processHashesInChain(final Bytes32 head, NodeProcessor processor); List<Bytes32> collectChainRoots(
      final Bytes32 head, Function<Bytes32, Boolean> shouldContinue); void processHashesInChainWhile(final Bytes32 head, HaltableNodeProcessor nodeProcessor); int countChildren(final Bytes32 hash); boolean contains(final Bytes32 blockRoot); int size(); Stream<Bytes32> preOrderStream(); Stream<Bytes32> breadthFirstStream(); @Override boolean equals(Object o); @Override int hashCode(); }
HashTree { public static Builder builder() { return new Builder(); } private  HashTree(
      final Bytes32 rootHash,
      final Map<Bytes32, Bytes32> childToParent,
      final Map<Bytes32, Set<Bytes32>> parentToChildren); static Builder builder(); Builder updater(); Builder withRoot(final Bytes32 newRootHash); Bytes32 getRootHash(); Optional<Bytes32> getParent(final Bytes32 childRoot); Set<Bytes32> getAllRoots(); void processHashesInChain(final Bytes32 head, NodeProcessor processor); List<Bytes32> collectChainRoots(
      final Bytes32 head, Function<Bytes32, Boolean> shouldContinue); void processHashesInChainWhile(final Bytes32 head, HaltableNodeProcessor nodeProcessor); int countChildren(final Bytes32 hash); boolean contains(final Bytes32 blockRoot); int size(); Stream<Bytes32> preOrderStream(); Stream<Bytes32> breadthFirstStream(); @Override boolean equals(Object o); @Override int hashCode();  }