### Question:
ParseString implements IsParser<String> { @Override public String parse(JsonParser parser, Field field) throws IOException { return isValid(parser) ? parser.getValueAsString() : null; }  @Override String parse(JsonParser parser, Field field);  }### Answer:
@Test public void parse() throws Exception { String expected = "42"; ParseString parseString = new ParseString(); String actual = parseString.parse(getParser("<string>42</string>"), null); assertEquals(expected, actual); }
@Test public void parseEmpty() throws Exception { String expected = null; ParseString parseString = new ParseString(); String actual = parseString.parse(getParser("<string></string>"), null); assertEquals(expected, actual); }
@Test public void parseSpace() throws Exception { String expected = null; ParseString parseString = new ParseString(); String actual = parseString.parse(getParser("<string> </string>"), null); assertEquals(expected, actual); }