### Question:
GetTableDataSupport { protected static Date maxAllowableDateFromUnit(Date fromDate, UnitSizes unit) { DateTime jodaDate = new DateTime(fromDate); switch (unit) { case HOUR: return jodaDate.hourOfDay().roundFloorCopy().toDate(); case DAY: return jodaDate.withHourOfDay(0).hourOfDay().roundFloorCopy().toDate(); case WEEK: return jodaDate.weekOfWeekyear().roundFloorCopy().toDate(); case MONTH: return jodaDate.monthOfYear().roundFloorCopy().toDate(); case YEAR: return jodaDate.withMonthOfYear(1).withDayOfMonth(1).withHourOfDay(0).hourOfDay().roundFloorCopy().toDate(); } return fromDate; } GetTableDataSupport(Connection conn, int timeout); ResultSet selectFullLoad(String tableName, String[] selectFields); ResultSet selectIncremental(String tableName, String[] selectFields, String dateField, int overlapTime, Date lastLoadDate, int backoffTime, UnitSizes unit);  }### Answer:
@Test public void testMaxAllowableDateFromUnit() throws Exception { assertEquals(1458872629591L, GetTableDataSupport.maxAllowableDateFromUnit(testDate, GetTableDataSupport.UnitSizes.NONE).getTime()); assertEquals(1458871200000L, GetTableDataSupport.maxAllowableDateFromUnit(testDate, GetTableDataSupport.UnitSizes.HOUR).getTime()); assertEquals(1458802800000L, GetTableDataSupport.maxAllowableDateFromUnit(testDate, GetTableDataSupport.UnitSizes.DAY).getTime()); assertEquals(1458543600000L, GetTableDataSupport.maxAllowableDateFromUnit(testDate, GetTableDataSupport.UnitSizes.WEEK).getTime()); assertEquals(1456819200000L, GetTableDataSupport.maxAllowableDateFromUnit(testDate, GetTableDataSupport.UnitSizes.MONTH).getTime()); assertEquals(1451635200000L, GetTableDataSupport.maxAllowableDateFromUnit(testDate, GetTableDataSupport.UnitSizes.YEAR).getTime()); }