@Override
    public Optional<String> resolveHostname(String ipAddress) {
        if (!explicitReverseRecords) {
            return records.entrySet().stream()
                          .filter(kv -> kv.getValue().contains(ipAddress))
                          .map(Map.Entry::getKey)
                          .findFirst();
        }
        return Optional.ofNullable(records.get(ipAddress))
                       .flatMap(values -> values.stream().findFirst());
    }
When true, only records added with {@link MockNameResolver#addReverseRecord(String, String)} are considered by
{@link MockNameResolver#resolveHostname(String)}. Otherwise the latter returns the IP address by reversing the lookup
implicitly.
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/testutils/MockNameResolver.java