@Test
public void testIsValidDateTimeExactPrecision() {

    assertTrue(isValidDateTime("2009", YEAR_PRECISION, YEAR_PRECISION));
    assertTrue(isValidDateTime("200902", YEAR_PRECISION, MONTH_PRECISION));
    assertTrue(isValidDateTime("20090228", YEAR_PRECISION, DATE_PRECISION));
    assertTrue(isValidDateTime("200902281205", DATE_PRECISION,
            DATETIME_MINUTE_PRECISION));
    assertTrue(isValidDateTime("200902281205+0001", DATE_PRECISION,
            DATETIME_MINUTE_PRECISION));
    assertTrue(isValidDateTime("20090228120556", DATETIME_SECOND_PRECISION,
            DATETIME_SECOND_PRECISION));
    assertFalse(isValidDateTime("2009", DATE_PRECISION, DATE_PRECISION));
    assertFalse(isValidDateTime("20090230", YEAR_PRECISION, YEAR_PRECISION));
}