public static Long toLong(Object o) {
        if (o == null) {
            return null;
        } else if (o instanceof Number) {
            return ((Number) o).longValue();
        } else if (o instanceof String) {
            try {
                return Long.parseLong((String) o);
            } catch (NumberFormatException ignored) {
                return null;
            }
        } else {
            return null;
        }
    }
@Test
    public void testToLong() {
        Assert.assertNull(Util.toLong(null));
        Assert.assertEquals(Util.toLong(100).longValue(), 100L);
        Assert.assertEquals(Util.toLong(100.0).longValue(), 100L);
        Assert.assertEquals(Util.toLong("100").longValue(), 100L);
        Assert.assertNull(Util.toLong("ABC"));
        Assert.assertNull(Util.toLong(new byte[] {'a', 'b', 'c'}));
    }