DateChecker { public int getIntValue(String dayString) { final int daysAWeek = 7; int days = daysAWeek; try { days = Integer.valueOf(dayString); } catch (Exception e) { LOG.error("Error while parsing day number param: " + dayString, e); days = daysAWeek; } return days; }  Date checkIfDateIsPast(Date date, String daysDeltaString); int getIntValue(String dayString);  }
@Test public void testGetIntValue() { Assert.assertEquals(7, dateChecker.getIntValue("7")); Assert.assertEquals(3, dateChecker.getIntValue("3")); Assert.assertEquals(7, dateChecker.getIntValue("illegal")); }