LocalDateToIntConverter { public static LocalDate convertToLocalDate(int date) { if (date == Integer.MAX_VALUE) { return LocalDate.MAX; } if (date == Integer.MIN_VALUE) { return LocalDate.MIN; } int year = date / 10000; int month = (date / 100) % 100; int day = date % 100; return LocalDate.of(year, month, day); } private  LocalDateToIntConverter(); static int convertToInt(LocalDate date); static LocalDate convertToLocalDate(int date); static void checkValid(int date);  }
@Test(dataProvider = "conversions") public void test_convertToLocalDate(LocalDate expected, int input) { assertEquals(LocalDateToIntConverter.convertToLocalDate(input), expected); }