### Question:
PlatformPartitionSerializer implements Serializer<PlatformPartition> { @Override public byte[] serialize(PlatformPartition value) throws IllegalArgumentException { return ByteUtil.intToBytes(value.getId()); }  @Override byte[] serialize(PlatformPartition value); @Override void serialize(PlatformPartition value, OutputStream out);  }### Answer:
@Test public void testSerialize() { assertArrayEquals(new byte[] { -128, 0, 0, 0 }, serializer.serialize(new DefaultPartition(Integer.MIN_VALUE))); assertArrayEquals(new byte[] { -1, -1, -1, -1 }, serializer.serialize(new DefaultPartition(-1))); assertArrayEquals(new byte[] { 0, 0, 0, 0 }, serializer.serialize(new DefaultPartition(0))); assertArrayEquals(new byte[] { 0, 0, 0, 1 }, serializer.serialize(new DefaultPartition(1))); assertArrayEquals(new byte[] { 1, 2, 3, 4 }, serializer.serialize(new DefaultPartition(0x01020304))); assertArrayEquals(new byte[] { 127, -1, -1, -1 }, serializer.serialize(new DefaultPartition(Integer.MAX_VALUE))); }