code: private CharType nearestCharType(CharType... types) {
      for (Character chr : chars) {
        for (CharType type : types) {
          if (type.isMatchedBy(chr)) {
            return type;
          }
        }
      }
      return CharType.EOL;
    }
docs: Finds the nearest character type.
  
  @param types
  the character types to choose from
  @return the nearest character type or {@code EOL}