@Test public void testExecute() { Calendar day = Calendar.getInstance(); Date yesterday = sut.execute(1); long diff = day.getTimeInMillis() - yesterday.getTime() - msInDay; Assert.assertTrue(diff < msIn1Min); }
public Date execute(final int daysAgo) { Calendar today = Calendar.getInstance(); today.add(Calendar.DATE, -daysAgo); return new Date(today.getTimeInMillis()); }
GetDateFromDaysAgoStrategy { public Date execute(final int daysAgo) { Calendar today = Calendar.getInstance(); today.add(Calendar.DATE, -daysAgo); return new Date(today.getTimeInMillis()); } }
GetDateFromDaysAgoStrategy { public Date execute(final int daysAgo) { Calendar today = Calendar.getInstance(); today.add(Calendar.DATE, -daysAgo); return new Date(today.getTimeInMillis()); }  }
GetDateFromDaysAgoStrategy { public Date execute(final int daysAgo) { Calendar today = Calendar.getInstance(); today.add(Calendar.DATE, -daysAgo); return new Date(today.getTimeInMillis()); }  Date execute(final int daysAgo); }
GetDateFromDaysAgoStrategy { public Date execute(final int daysAgo) { Calendar today = Calendar.getInstance(); today.add(Calendar.DATE, -daysAgo); return new Date(today.getTimeInMillis()); }  Date execute(final int daysAgo);  }