code: private String[] convertToArray(String newAddress) {
          int start = 0;
          String sub;
          List<String> addressWords = new ArrayList<String>();
  
          String addr = newAddress;
          while (true) {
              // fill address from back to front
              start = addr.lastIndexOf('.');
              if (start != -1) {
                  sub = addr.substring(start + 1);
                  addressWords.add(sub);
              } else {
                  addressWords.add(addr);
                  break;
              }
              addr = addr.substring(0, start);
          }
  
          String[] sa = new String[addressWords.size()];
          sa = addressWords.toArray(sa);
          return (sa);
      }
docs: convert an address to a string array, where each level in the array
  represent a substring between two periods (".") of the address.
  The rightmost substring will be at index 0, and so on.
  
  @param newAddress
  the address to convert
  @return the String array representing the substrings of the address