docs: public static String soundex(String s) {
  
          if (s == null) {
              return s;
          }
  
          s = s.toUpperCase(Locale.ENGLISH);
  
          int    len       = s.length();
          char[] b         = new char[] {
              '0', '0', '0', '0'
          };
          char   lastdigit = '0';
  
          for (int i = 0, j = 0; i < len && j < 4; i++) {
              char c = s.charAt(i);
              char newdigit;
  
              if ("AEIOUY".indexOf(c) != -1) {
                  newdigit = '7';
              } else if (c == 'H' || c == 'W') {
                  newdigit = '8';
              } else if ("BFPV".indexOf(c) != -1) {
                  newdigit = '1';
              } else if ("CGJKQSXZ".indexOf(c) != -1) {
                  newdigit = '2';
              } else if (c == 'D' || c == 'T') {
                  newdigit = '3';
              } else if (c == 'L') {
                  newdigit = '4';
              } else if (c == 'M' || c == 'N') {
                  newdigit = '5';
              } else if (c == 'R') {
                  newdigit = '6';
              } else {
                  continue;
              }
  
              if (j == 0) {
                  b[j++]    = c;
                  lastdigit = newdigit;
              } else if (newdigit <= '6') {
                  if (newdigit != lastdigit) {
                      b[j++]    = newdigit;
                      lastdigit = newdigit;
                  }
              } else if (newdigit == '7') {
                  lastdigit = newdigit;
              }
          }
  
          return new String(b, 0, 4);
      }