### Question:
CodeSetParser extends AbstractMultiTagParser<CodeSet> { @Override protected CodeSet parseElement(final String line) { final EtmPoint point = PointFactory.getPoint(getClass(), "parseElement(String)"); try { final int firstSpace = line.indexOf(' '); if (firstSpace < 0) { throw new InvalidDocumentationException("No space found in code set definition: " + line); } final int secondSpace = line.indexOf(' ', firstSpace + 1); if (secondSpace < 0) { return new CodeSet(Integer.parseInt(line.substring(firstSpace + 1))); } final int codeSet = Integer.parseInt(line.substring(firstSpace + 1, secondSpace)); final String description = line.substring(secondSpace + 1); return new CodeSet(codeSet, description); } finally { point.collect(); } }    }### Answer:
@Test public void testParse() throws Exception { final int codeSetNumber = 7848; final String documentation = "i am the documentation"; final String line = "@codeSet " + Integer.toString(codeSetNumber) + " " + documentation; final CodeSet codeSet = mock(CodeSet.class); whenNew(CodeSet.class).withArguments(Integer.valueOf(codeSetNumber), documentation).thenReturn(codeSet); assertThat(parser.parseElement(line)).isEqualTo(codeSet); }
@Test public void testParseNoDocumentation() throws Exception { final int codeSetNumber = 7848; final String line = "@codeSet " + Integer.toString(codeSetNumber); final CodeSet codeSet = mock(CodeSet.class); whenNew(CodeSet.class).withArguments(Integer.valueOf(codeSetNumber)).thenReturn(codeSet); assertThat(parser.parseElement(line)).isEqualTo(codeSet); }
@Test public void testParseNoFirstSpace() { final String codeSet = "@codeSet237"; InvalidDocumentationException e = assertThrows(InvalidDocumentationException.class, () -> { parser.parseElement(codeSet); }); assertThat(e.getMessage()).isEqualTo("No space found in code set definition: " + codeSet); }