### Question:
NumberUtils { public static int toInt(final String str, final int defaultValue) { if (str == null) { return defaultValue; } try { return Integer.parseInt(str); } catch (NumberFormatException nfe) { return defaultValue; } }  static int toInt(final String str, final int defaultValue); static Long toLong(String str, final Long defaultValue); static Long toLong(String str);  }### Answer:
@Test public void testToInReturnDefaultValueWithNull() { Assertions.assertEquals(10, NumberUtils.toInt(null, 10)); }
@Test public void testToInReturnDefaultValueWithFormatIsInvalid() { Assertions.assertEquals(10, NumberUtils.toInt("nine", 10)); }
@Test public void testToInReturnParsedValue() { Assertions.assertEquals(10, NumberUtils.toInt("10", 9)); }