final String DOC = "{\"name\":123,\"name2\":14,\"x\":\"name\"}";
JsonFactory jf = new JsonFactory();
JsonParser jp = useStream ?
jf.createJsonParser(new ByteArrayInputStream(DOC.getBytes("UTF-8")))
: jf.createJsonParser(new StringReader(DOC));
SerializableString NAME = new SerializedString("name");
assertFalse(jp.nextFieldName(NAME));
assertToken(JsonToken.START_OBJECT, jp.getCurrentToken());
assertTrue(jp.nextFieldName(NAME));
assertToken(JsonToken.FIELD_NAME, jp.getCurrentToken());
assertEquals(NAME.getValue(), jp.getCurrentName());
assertEquals(NAME.getValue(), jp.getText());
assertFalse(jp.nextFieldName(NAME));
assertToken(JsonToken.VALUE_NUMBER_INT, jp.getCurrentToken());
assertEquals(123, jp.getIntValue());
assertFalse(jp.nextFieldName(NAME));