### Question:
SingleTagParser extends AbstractIndexedParser<String> { @Override public boolean canParse(final String line) { if (line == null) { throw new IllegalArgumentException("Line cannot be null."); } return line.startsWith(tag); } SingleTagParser(final String tag); @Override boolean canParse(final String line); @Override String parse(final int startingIndex, final List<String> lines);  }### Answer:
@Test public void testCanParse() { assertThat(parser.canParse(tag)).isTrue(); assertThat(parser.canParse(StringUtils.reverse(tag))).isFalse(); }
@Test public void testCanParseNullLine() { IllegalArgumentException e = assertThrows(IllegalArgumentException.class, () -> { parser.canParse(null); }); assertThat(e.getMessage()).isEqualTo("Line cannot be null."); }