SchemaVersionUtils { public static int decodeAvroSchemaVersion(final byte versionByte) { checkArgument((versionByte >= MIN_ENCODED_VERSION && versionByte <= MAX_ENCODED_VERSION) && versionByte % 2 == 0); return versionByte >> 1; } private  SchemaVersionUtils(); static boolean processSchemaVersion(final byte versionByte, final int supportedVersion); static int decodeAvroSchemaVersion(final byte versionByte);  }
@Test(expected = IllegalArgumentException.class) public void testDecodeAvroSchemaVersionExceedMinimumValue() { SchemaVersionUtils.decodeAvroSchemaVersion((byte)-5); }
@Test(expected = IllegalArgumentException.class) public void testDecodeAvroSchemaVersionExceedMaximumValue() { SchemaVersionUtils.decodeAvroSchemaVersion((byte)0x7F); }
@Test(expected = IllegalArgumentException.class) public void testDecodeAvroSchemaVersionOddEncodedValue() { SchemaVersionUtils.decodeAvroSchemaVersion((byte)0x01); }