code: @Override
    public boolean nextBoolean()
    {
      int p = peeked;
      if (p == PEEKED_NONE) {
        p = doPeek();
      }
      if (p == PEEKED_TRUE) {
        peeked = PEEKED_NONE;
        return true;
      } else if (p == PEEKED_FALSE) {
        peeked = PEEKED_NONE;
        return false;
      }
      throw new IllegalStateException("Expected a boolean but was " + peek()
          + " at line " + getLineNumber() + " column " + getColumnNumber());
    }
docs: {@inheritDoc}