@Test
public void testOnDateFormat() {

    assertThatNullPointerException().isThrownBy(() -> Parsers.onDateFormat(null));
    assertCompliance(Parsers.onDateFormat(DateFormat.getDateInstance()));
    Parser<Date> p = Parsers.onDateFormat(new SimpleDateFormat("yyyy-MM", Locale.ROOT));
    assertThat(p.parse("2010-01")).isEqualTo("2010-01-01");
    assertThat(p.parse("2010-02")).isEqualTo("2010-02-01");
    assertThat(p.parse("2010-01-01")).isNull();
    assertThat(p.parse("2010-01x")).isNull();
    assertThat(p.parse("x2010-01")).isNull();
}