public static long toLong(Object val) {
        if (val instanceof Long) {
            return (Long) val;
        }
        return toLong(val.toString());
    }
@Test
    void testToLong() {
        // ConvertUtils.toLong(Object)
        assertEquals(0L, ConvertUtils.toLong(new ArrayList<>()));
        assertEquals(10L, ConvertUtils.toLong((Object) 10L));
        
        // ConvertUtils.toLong(String)
        assertEquals(0L, ConvertUtils.toLong("0"));
        assertEquals(-1L, ConvertUtils.toLong("-1"));
        assertEquals(10L, ConvertUtils.toLong("10"));
        assertEquals(Long.MAX_VALUE, ConvertUtils.toLong(String.valueOf(Long.MAX_VALUE)));
        assertEquals(Long.MIN_VALUE, ConvertUtils.toLong(String.valueOf(Long.MIN_VALUE)));
        assertEquals(0L, ConvertUtils.toLong("notIntValue"));
        
        // ConvertUtils.toLong(String, Integer)
        assertEquals(0L, ConvertUtils.toLong("0", 100L));
        assertEquals(100L, ConvertUtils.toLong(null, 100L));
        assertEquals(100L, ConvertUtils.toLong("null", 100L));
        assertEquals(100L, ConvertUtils.toLong("notIntValue", 100L));
    }