public static String u2or4(int v) {
        if (v == (char) v) {
            return u2(v);
        } else {
            return u4(v);
        }
    }
@Test
    public void testU2or4() {
        Assert.assertEquals("0000", Hex.u2or4(0));
        Assert.assertEquals("04d2", Hex.u2or4(1234));
        Assert.assertEquals("0001e240", Hex.u2or4(123456));
        Assert.assertEquals("00bc614e", Hex.u2or4(12345678));
        Assert.assertEquals("499602d2", Hex.u2or4(1234567890));
    }