public static boolean isPubKeyCompressed(byte[] encoded) {
        if (encoded.length == 33 && (encoded[0] == 0x02 || encoded[0] == 0x03))
            return true;
        else if (encoded.length == 65 && encoded[0] == 0x04)
            return false;
        else
            throw new IllegalArgumentException(ByteUtils.formatHex(encoded));
    }
@Test
    public void isPubKeyCompressed() {
        assertFalse(ECKey.isPubKeyCompressed(ByteUtils.parseHex(
                "04cfb4113b3387637131ebec76871fd2760fc430dd16de0110f0eb07bb31ffac85e2607c189cb8582ea1ccaeb64ffd655409106589778f3000fdfe3263440b0350")));
        assertTrue(ECKey.isPubKeyCompressed(ByteUtils.parseHex(
                "036d27f617ce7b0cbdce0abebd1c7aafc147bd406276e6a08d64d7a7ed0ca68f0e")));
        assertTrue(ECKey.isPubKeyCompressed(ByteUtils.parseHex(
                "0238746c59d46d5408bf8b1d0af5740fe1a6e1703fcb56b2953f0b965c740d256f")));
    }