class PostcoderWeb implements AddressLookupService {

    @Override
    public ServiceResult<List<AddressResource>> doLookup(String lookup) {
        if (StringUtils.isEmpty(lookup)) {
            return ServiceResult.serviceSuccess(new ArrayList<>());
        } else if (StringUtils.isEmpty(postcodeLookupUrl) || StringUtils.isEmpty(postcodeLookupKey)) {
            return ServiceResult.serviceSuccess(exampleAddresses());
        } else {
            return doAPILookup(lookup);
        }
    }

}