public Type getGELFType() {
        if (payload.length < Type.HEADER_SIZE) {
            throw new IllegalStateException("GELF message is too short. Not even the type header would fit.");
        }
        return Type.determineType(payload[0], payload[1]);
    }
@Test
    public void testGetGELFTypeDetectsZLIBCompressedMessage() throws Exception {
        byte[] fakeData = new byte[20];
        fakeData[0] = (byte) 0x78;
        fakeData[1] = (byte) 0x9c;

        GELFMessage msg = new GELFMessage(fakeData);
        assertEquals(GELFMessage.Type.ZLIB, msg.getGELFType());
    }