### Question:
PrivateWorldStateReader { public List<PrivateTransactionMetadata> getPrivateTransactionMetadataList( final String privacyGroupId, final Hash blockHash) { final Bytes32 privacyGroupIdBytes = Bytes32.wrap(Bytes.fromBase64String(privacyGroupId)); final Optional<PrivateBlockMetadata> privateBlockMetadata = privateStateStorage.getPrivateBlockMetadata(blockHash, privacyGroupIdBytes); return privateBlockMetadata .map(PrivateBlockMetadata::getPrivateTransactionMetadataList) .orElse(Collections.emptyList()); } PrivateWorldStateReader(
      final PrivateStateRootResolver privateStateRootResolver,
      final WorldStateArchive privateWorldStateArchive,
      final PrivateStateStorage privateStateStorage); Optional<Bytes> getContractCode(
      final String privacyGroupId, final Hash blockHash, final Address contractAddress); List<PrivateTransactionMetadata> getPrivateTransactionMetadataList(
      final String privacyGroupId, final Hash blockHash); Optional<PrivateTransactionReceipt> getPrivateTransactionReceipt(
      final Hash blockHash, final Hash transactionHash);  }### Answer:
@Test public void getPrivateTransactionsMetadataReturnEmptyListWhenNoPrivateBlockFound() { when(privateStateStorage.getPrivateBlockMetadata(eq(blockHash), eq(PRIVACY_GROUP_ID_BYTES))) .thenReturn(Optional.empty()); final List<PrivateTransactionMetadata> privateTransactionsMetadata = privateWorldStateReader.getPrivateTransactionMetadataList(PRIVACY_GROUP_ID, blockHash); assertThat(privateTransactionsMetadata).isEmpty(); }
@Test public void getPrivateTransactionsMetadataReturnExpectedMetadataList() { final PrivateBlockMetadata privateBlockMetadata = generatePrivateBlockMetadata(3); when(privateStateStorage.getPrivateBlockMetadata(eq(blockHash), eq(PRIVACY_GROUP_ID_BYTES))) .thenReturn(Optional.of(privateBlockMetadata)); final List<PrivateTransactionMetadata> privateTransactionsMetadata = privateWorldStateReader.getPrivateTransactionMetadataList(PRIVACY_GROUP_ID, blockHash); assertThat(privateTransactionsMetadata) .hasSize(3) .containsAll(privateBlockMetadata.getPrivateTransactionMetadataList()); }