HeartbeatMessageHandler extends ProtocolMessageHandler<HeartbeatMessage> { @Override public HeartbeatMessageSerializer getSerializer(HeartbeatMessage message) { return new HeartbeatMessageSerializer(message, tlsContext.getChooser().getSelectedProtocolVersion()); } HeartbeatMessageHandler(TlsContext tlsContext); @Override HeartbeatMessageParser getParser(byte[] message, int pointer); @Override HeartbeatMessagePreparator getPreparator(HeartbeatMessage message); @Override HeartbeatMessageSerializer getSerializer(HeartbeatMessage message); @Override void adjustTLSContext(HeartbeatMessage message);  }
@Test public void testGetSerializer() { assertTrue(handler.getSerializer(new HeartbeatMessage()) instanceof HeartbeatMessageSerializer); }