### Question:
DepositDataMerkle implements MerkleTree<DepositData> { Function<BytesValue, Hash32> getHashFunction() { return hashFunction; } DepositDataMerkle(Function<BytesValue, Hash32> hashFunction, int treeDepth);   }### Answer:
@Test public void proofIsValidForVariousNumberOfDeposits() { int maxCount = 16; BeaconChainSpec spec = BeaconChainSpec.createWithDefaults(); MerkleTree<DepositData> tree = new DepositBufferedMerkle( spec.getHashFunction(), spec.getConstants().getDepositContractTreeDepth().getIntValue(), maxCount); List<DepositData> sourceList = new ArrayList<>(); for (int count = 1; count < maxCount; count++) { sourceList.add(createDepositData(count - 1)); tree.addValue(sourceList.get(count - 1)); ReadList<Integer, DepositData> depositDataList = ReadList.wrap( sourceList, Integer::new, 1L << spec.getConstants().getDepositContractTreeDepth().getIntValue()); for (int i = 0; i < count; i++) { Hash32 leaf = spec.hash_tree_root(depositDataList.get(i)); List<Hash32> proof = tree.getProof(i, count); assertTrue( spec.is_valid_merkle_branch( leaf, proof, spec.getConstants().getDepositContractTreeDepthPlusOne(), UInt64.valueOf(i), spec.hash_tree_root(depositDataList))); } } }