### Question:
ChainDataProvider { public Optional<BeaconHead> getBeaconHead() { if (!isStoreAvailable()) { throw new ChainDataUnavailableException(); } return recentChainData.getHeadBlockAndState().map(BeaconHead::new); } ChainDataProvider(
      final RecentChainData recentChainData,
      final CombinedChainDataClient combinedChainDataClient); UInt64 getGenesisTime(); Optional<BeaconHead> getBeaconHead(); GetForkResponse getForkInfo(); SafeFuture<Optional<List<Committee>>> getCommitteesAtEpoch(final UInt64 epoch); SafeFuture<Optional<GetBlockResponse>> getBlockBySlot(final UInt64 slot); boolean isStoreAvailable(); Optional<Bytes32> getBestBlockRoot(); UInt64 getCurrentEpoch(); SafeFuture<Optional<GetBlockResponse>> getBlockByBlockRoot(final Bytes32 blockParam); SafeFuture<Optional<BeaconState>> getStateByBlockRoot(final Bytes32 blockRoot); SafeFuture<Optional<BeaconState>> getStateByStateRoot(final Bytes32 stateRoot); SafeFuture<Optional<BeaconState>> getStateAtSlot(final UInt64 slot); SafeFuture<Optional<Bytes32>> getStateRootAtSlot(final UInt64 slot); SafeFuture<Optional<BeaconValidators>> getValidatorsByValidatorsRequest(
      final ValidatorsRequest request); boolean isFinalized(final SignedBeaconBlock signedBeaconBlock); boolean isFinalized(final UInt64 slot); boolean isFinalizedEpoch(final UInt64 epoch); Optional<BeaconChainHead> getHeadState(); Optional<UInt64> stateParameterToSlot(final String pathParam); Optional<Integer> validatorParameterToIndex(final String validatorParameter); SafeFuture<Optional<Fork>> getForkAtSlot(final UInt64 slot); SafeFuture<Optional<ValidatorResponse>> getValidatorDetails(
      final Optional<UInt64> maybeSlot, final Optional<Integer> maybeIndex); Optional<Bytes32> getStateRootFromBlockRoot(final Bytes32 blockRoot);  }### Answer:
@Test public void getBeaconHead_shouldReturnPopulatedBeaconHead() { final ChainDataProvider provider = new ChainDataProvider(recentChainData, combinedChainDataClient); final Optional<BeaconHead> optionalBeaconHead = provider.getBeaconHead(); assertThat(optionalBeaconHead.isPresent()).isTrue(); final BeaconHead head = optionalBeaconHead.get(); assertEquals(blockRoot, head.block_root); assertEquals(beaconStateInternal.hash_tree_root(), head.state_root); assertEquals(recentChainData.getHeadSlot(), head.slot); }