docs: private static int nextDollar(String className, CharSequence current, int searchStart) {
      while (true) {
        int index = className.indexOf('$', searchStart);
        if (index == -1) {
          return -1;
        }
        // We'll never have two dots nor will a type name end or begin with dot. So no need to
        // consider dollars at the beginning, end, or adjacent to dots.
        if (index == 0 || index == className.length() - 1
            || current.charAt(index - 1) == '.' || current.charAt(index + 1) == '.') {
          searchStart = index + 1;
          continue;
        }
        return index;
      }
    }