NumberUtils { public static long toLongDefaultIfNull(Long configured, long theDefault) { return configured != null ? configured.longValue() : theDefault; }  static int toIntDefaultIfNull(Integer configured, int theDefault); static long toLongDefaultIfNull(Long configured, long theDefault);  }
@Test public void testToLongDefaultIfNull() { assertEquals(1L, toLongDefaultIfNull(Long.valueOf(1), 10L)); assertEquals(10L, toLongDefaultIfNull(null, 10L)); }