### Question:
HttpHelper { public static long toLong(final String value, final long def) { if (Strings.isNullOrEmpty(value)) { return def; } try { return Long.parseLong(value); } catch (final NumberFormatException e) { logger.warn(e); return def; } } private  HttpHelper(); static long toLong(final String value, final long def); static int toInt(final String value, final int def);  }### Answer:
@Test public void testToLong() throws Exception { assertEquals(1234567890123L, HttpHelper.toLong("1234567890123", 0)); assertEquals(-1234567890123L, HttpHelper.toLong("-1234567890123", 0)); assertEquals(0, HttpHelper.toLong("1a", 0)); assertEquals(0, HttpHelper.toLong("a", 0)); }