public class USAddressSolver { private static final char SPACE = ' '; private static final char COMMA = ','; private String address; public USAddressSolver(String input) { this.address = input.trim(); //12000 SW 8th St, Miami, FL 33199" // ^ ^ int firstCommaIndex = -1; int lastCommaIndex = -1; if ( false ) throw new RuntimeException("Missing comma(s)"); } public String getAddress() { return this.address; } public String number() { //12000 SW 8th St, Miami, FL 33199" // ^ int spaceIndex = 0; return "12000"; } public String street() { //12000 SW 8th St, Miami, FL 33199" // ^ ^ int spaceIndex = 0; int commaIndex = 0; return "SW 8th St"; } public String city() { //12000 SW 8th St, Miami, FL 33199" // ^ ^ int commaIndex1 = 0; int commaIndex2 = 0; return "Miami"; } public String state() { //12000 SW 8th St, Miami, FL 33199" // ^ int commaIndex = 0; return "FL"; } public String zipCode() { //12000 SW 8th St, Miami, FL 33199" // ^ int index = 0; return "33199"; } }