@Test public void shouldReturnMaxDate() { DateAxisBoundCounter dateAxisBoundCounter = new DateAxisBoundCounter(); ThreadCountEntity first = createEntityFromDate(new Date(new Date().getTime() - 2)); ThreadCountEntity second = createEntityFromDate(new Date()); Date result = dateAxisBoundCounter.getMaxDate(Arrays.asList(first, second)); assertEquals(result, second.getTime()); }
public ThreadCountEntity createEntityFromDate(Date date) { ThreadCountEntity threadCountEntity = new ThreadCountEntity(); threadCountEntity.setTime(date); return threadCountEntity; }