code: private Character consumeNextCharacter(CharType... expected) {
          try {
              return chars.consume(expected);
          } catch (UnexpectedElementException e) {
              throw new UnexpectedCharacterException(e);
          }
      }
docs: Tries to consume the next character in the stream.
  
  @param expected the expected types of the next character
  @return the next character in the stream
  @throws UnexpectedCharacterException when encounters an unexpected character type