@Test public void create_extraSlotLookup() { final Bytes32 rootHash = Bytes32.fromHexStringLenient("0x01"); final Bytes32 rootParent = Bytes32.fromHexStringLenient("0x00"); final Bytes32 childHash = Bytes32.fromHexStringLenient("0x02"); final Bytes32 otherHash = Bytes32.fromHexStringLenient("0x03"); final Map<Bytes32, Bytes32> childToParent = Map.of( rootHash, rootParent, childHash, rootHash); final Map<Bytes32, UInt64> slotLookup = Map.of( rootHash, UInt64.ONE, childHash, UInt64.valueOf(2), otherHash, UInt64.valueOf(3)); final HashTree hashTree = HashTree.builder().rootHash(rootHash).childAndParentRoots(childToParent).build(); assertThatThrownBy(() -> BlockTree.create(hashTree, slotLookup)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("Slot lookup and hash tree must contain the same number of elements"); }
public static BlockTree create( final HashTree hashTree, final Map<Bytes32, UInt64> blockRootToSlot) { return new BlockTree(hashTree, blockRootToSlot); }
BlockTree { public static BlockTree create( final HashTree hashTree, final Map<Bytes32, UInt64> blockRootToSlot) { return new BlockTree(hashTree, blockRootToSlot); } }
BlockTree { public static BlockTree create( final HashTree hashTree, final Map<Bytes32, UInt64> blockRootToSlot) { return new BlockTree(hashTree, blockRootToSlot); } private  BlockTree(final HashTree hashTree, final Map<Bytes32, UInt64> blockRootToSlot); }
BlockTree { public static BlockTree create( final HashTree hashTree, final Map<Bytes32, UInt64> blockRootToSlot) { return new BlockTree(hashTree, blockRootToSlot); } private  BlockTree(final HashTree hashTree, final Map<Bytes32, UInt64> blockRootToSlot); static BlockTree create(
      final HashTree hashTree, final Map<Bytes32, UInt64> blockRootToSlot); BlockTree updated(final Bytes32 newRoot, Collection<SignedBeaconBlock> newBlocks); HashTree getHashTree(); Bytes32 getRootHash(); boolean contains(final Bytes32 blockRoot); Set<Bytes32> getAllRoots(); List<Bytes32> getOrderedBlockRoots(); boolean isRootAtNthEpochBoundary(Bytes32 blockRoot, final int n); UInt64 getEpoch(Bytes32 blockRoot); int size(); @Override boolean equals(final Object o); @Override int hashCode(); }
BlockTree { public static BlockTree create( final HashTree hashTree, final Map<Bytes32, UInt64> blockRootToSlot) { return new BlockTree(hashTree, blockRootToSlot); } private  BlockTree(final HashTree hashTree, final Map<Bytes32, UInt64> blockRootToSlot); static BlockTree create(
      final HashTree hashTree, final Map<Bytes32, UInt64> blockRootToSlot); BlockTree updated(final Bytes32 newRoot, Collection<SignedBeaconBlock> newBlocks); HashTree getHashTree(); Bytes32 getRootHash(); boolean contains(final Bytes32 blockRoot); Set<Bytes32> getAllRoots(); List<Bytes32> getOrderedBlockRoots(); boolean isRootAtNthEpochBoundary(Bytes32 blockRoot, final int n); UInt64 getEpoch(Bytes32 blockRoot); int size(); @Override boolean equals(final Object o); @Override int hashCode();  }