code: static private boolean matchPrefix(String s1, String s2) {
      return s1.startsWith(s2) || s2.startsWith(s1);
    }
docs: Checks with either of the strings starts with the other.
  @param s1 a String
  @param s2 a String
  @return true if s1 starts with s2 or s2 starts with s1, false otherwise