Last active
April 1, 2018 19:53
-
-
Save mjedynak/35a67287fcd1bb2a62372966ed254d3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CityRetriever { | |
private final PersonService personService; | |
public String retrieveCity(String name) { | |
Person person = personService.getByName(name); | |
if (person != null) { | |
Address address = person.getAddress(); | |
if (address != null) { | |
if (address.getCity() != null) { | |
return address.getCity(); | |
} | |
} | |
} | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment