code: public String nextName() throws IOException {
      int p = peeked;
      if (p == PEEKED_NONE) {
        p = doPeek();
      }
      String result;
      if (p == PEEKED_UNQUOTED_NAME) {
        result = nextUnquotedValue();
      } else if (p == PEEKED_SINGLE_QUOTED_NAME) {
        result = nextQuotedValue('\'');
      } else if (p == PEEKED_DOUBLE_QUOTED_NAME) {
        result = nextQuotedValue('"');
      } else {
        throw new IllegalStateException("Expected a name but was " + peek() + locationString());
      }
      peeked = PEEKED_NONE;
      pathNames[stackSize - 1] = result;
      return result;
    }
docs: Returns the next token, a {@link com.google.gson.stream.JsonToken#NAME property name}, and
  consumes it.
  
  @throws java.io.IOException if the next token in the stream is not a property
  name.