DateChanger { @SuppressWarnings("deprecation") Date switchDayMonthValue(Date date) { if (date == null) { return null; } int tempMonth = date.getMonth(); date.setMonth((date.getDate() - 1) % 12); date.setDate(tempMonth + 1); return date; }  void setSeed(long seed);  }
@Test public void testSwitchDayMonthValue() { String result = sdf.format(dateChanger.switchDayMonthValue(dateToModify)); assertEquals("08-01-1982", result); Date result2 = dateChanger.switchDayMonthValue(null); assertTrue(result2 == null); }