SimpleCsvParser should also have a test for when an empty String is passed to parser.parse(string).
The result should be the same as if the reader encountered an immediate EOF, which should correspond to a null being returned. Same behaviour as MultiLineCsv parser.

Test added and Failed:

  @Test
  public void returnNullWhenEmptyPassedIn() {
    assertNull(parser.parse(""));
  }


Changed the parse method to test for empty String. The parse0 method unchanged since it is used properly by parseNext and does not require the same check.

@Override
  public List<String> parse(String ln) {
    if (ln == null || ln.isEmpty()) {
      return null;
    }
    return parse0(ln);
  }