### Question:
DateUtils { static boolean isValidMonth(@Nullable String monthString) { if (monthString == null) { return false; } try { int monthInt = Integer.parseInt(monthString); return monthInt > 0 && monthInt <= 12; } catch (NumberFormatException numEx) { return false; } }    }### Answer:
@Test public void isValidMonth_forProperMonths_returnsTrue() { String[] validMonths = {"01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"}; for (int i = 0; i < validMonths.length; i++) { assertTrue(DateUtils.isValidMonth(validMonths[i])); } }
@Test public void isValidMonth_forInvalidNumericInput_returnsFalse() { assertFalse(DateUtils.isValidMonth("15")); assertFalse(DateUtils.isValidMonth("0")); assertFalse(DateUtils.isValidMonth("-08")); }
@Test public void isValidMonth_forNullInput_returnsFalse() { assertFalse(DateUtils.isValidMonth(null)); }
@Test public void isValidMonth_forNonNumericInput_returnsFalse() { assertFalse(DateUtils.isValidMonth(" ")); assertFalse(DateUtils.isValidMonth("abc")); assertFalse(DateUtils.isValidMonth("January")); assertFalse(DateUtils.isValidMonth("\n")); }