### Question:
OxmPbbIsidSerializer extends AbstractOxmMatchEntrySerializer { @Override public void serialize(MatchEntry entry, ByteBuf outBuffer) { super.serialize(entry, outBuffer); PbbIsidCase entryValue = (PbbIsidCase) entry.getMatchEntryValue(); outBuffer.writeMedium(entryValue.getPbbIsid().getIsid().intValue()); if (entry.isHasMask()) { writeMask(entryValue.getPbbIsid().getMask(), outBuffer, getValueLength()); } }  @Override void serialize(MatchEntry entry, ByteBuf outBuffer);  }### Answer:
@Test public void testSerializeWithMask() { MatchEntryBuilder builder = preparePbbIsidMatchEntry(false, 12345); ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); checkHeader(buffer, false); assertEquals("Wrong value", 12345, buffer.readUnsignedMedium()); assertTrue("Unexpected data", buffer.readableBytes() == 0); }
@Test public void testSerializeWithoutMask() { MatchEntryBuilder builder = preparePbbIsidMatchEntry(true, 6789); ByteBuf buffer = PooledByteBufAllocator.DEFAULT.buffer(); serializer.serialize(builder.build(), buffer); checkHeader(buffer, true); assertEquals("Wrong value", 6789, buffer.readUnsignedMedium()); byte[] tmp = new byte[3]; buffer.readBytes(tmp); Assert.assertArrayEquals("Wrong mask", new byte[]{0, 15, 10}, tmp); assertTrue("Unexpected data", buffer.readableBytes() == 0); }