### Question:
AddressService extends BaseNodeAddressService { public AddressesExistsResponse addressesCheckExistenceAndRequestHistoryNode(AddressBulkRequest addressRequest) { List<Hash> addressHashes = addressRequest.getAddresses(); LinkedHashMap<String, Boolean> addressHashToFoundStatusMap = new LinkedHashMap<>(); String historyNodeHttpAddress = getHistoryNodeHttpAddress(); addressHashes.removeIf(addressHash -> { if (addresses.getByHash(addressHash) != null) { addressHashToFoundStatusMap.put(addressHash.toHexString(), Boolean.TRUE); return true; } RequestedAddressHashData requestedAddressHashData = requestedAddressHashes.getByHash(addressHash); if (validateRequestedAddressHashExistsAndRelevant(requestedAddressHashData) || historyNodeHttpAddress == null) { addressHashToFoundStatusMap.put(addressHash.toHexString(), Boolean.FALSE); return true; } addressHashToFoundStatusMap.put(addressHash.toHexString(), null); return false; }); if (!addressHashes.isEmpty()) { fillUnknownAddressesFromHistoryResponse(addressHashes, addressHashToFoundStatusMap, historyNodeHttpAddress); } return new AddressesExistsResponse(addressHashToFoundStatusMap); }  boolean addAddress(Hash addressHash); AddressesExistsResponse addressesCheckExistenceAndRequestHistoryNode(AddressBulkRequest addressRequest);  }### Answer:
@Test public void addressesExist_addressInLocalDB_shouldReturnHashAndTrue() { AddressBulkRequest addressBulkRequest = AddressTestUtils.generateAddressBulkRequest( addressInLocalAddressesCollection.getHash()); AddressesExistsResponse actualResponse = addressService.addressesCheckExistenceAndRequestHistoryNode(addressBulkRequest); AddressesExistsResponse expectedResponse = AddressTestUtils.generateExpectedResponse( AddressTestUtils.initMapWithHashes( addressInLocalAddressesCollection.getHash()), Boolean.TRUE); Assert.assertTrue(AddressTestUtils.equals(expectedResponse, actualResponse)); }
@Test public void addressesExist_addressInLocalDbAndUpdatedFromHistoryLessThenTenMinutes_shouldReturnTrueAndFalse() { AddressBulkRequest addressBulkRequest = AddressTestUtils.generateAddressBulkRequest( addressInLocalAddressesCollection.getHash(), addressInRequestedAddressesCollectionLessThenTenMinutes.getHash()); AddressesExistsResponse actualResponse = addressService.addressesCheckExistenceAndRequestHistoryNode(addressBulkRequest); AddressesExistsResponse expectedResponse = AddressTestUtils.generateExpectedResponse( AddressTestUtils.initMapWithHashes( addressInLocalAddressesCollection.getHash(), addressInRequestedAddressesCollectionLessThenTenMinutes.getHash()), Boolean.TRUE, Boolean.FALSE); Assert.assertTrue(AddressTestUtils.equals(expectedResponse, actualResponse)); }