class AddressResolutionStatement extends ResolutionStatement<UnresolvedAddress, Address> {

  public static Optional<Address> getResolvedAddress(
      List<AddressResolutionStatement> statements,
      BigInteger height,
      UnresolvedAddress unresolvedAddress,
      long primaryId,
      long secondaryId) {
    if (unresolvedAddress instanceof Address) {
      return Optional.of((Address) unresolvedAddress);
    }
    return statements.stream()
        .filter(s -> height.equals(s.getHeight()))
        .filter(r -> r.getUnresolved().equals(unresolvedAddress))
        .map(
            r -> r.getResolutionEntryById(primaryId, secondaryId).map(ResolutionEntry::getResolved))
        .findFirst()
        .flatMap(Function.identity());
  }

  public  AddressResolutionStatement(
      String recordId,
      BigInteger height,
      UnresolvedAddress unresolved,
      List<ResolutionEntry<Address>> resolutionEntries);

}