HeartbeatExtensionParser extends ExtensionParser<HeartbeatExtensionMessage> { @Override public void parseExtensionMessageContent(HeartbeatExtensionMessage msg) { LOGGER.debug("Parsing HeartbeatExtensionMessage"); parseHeartbeatMode(msg); } HeartbeatExtensionParser(int startposition, byte[] array); @Override void parseExtensionMessageContent(HeartbeatExtensionMessage msg);  }
@Test public void testParseExtensionMessageContent() { HeartbeatExtensionParser parser = new HeartbeatExtensionParser(start, extension); HeartbeatExtensionMessage msg = parser.parse(); assertArrayEquals(msg.getExtensionBytes().getValue(), completeExtension); assertArrayEquals(type.getValue(), msg.getExtensionType().getValue()); assertTrue(extensionLength == msg.getExtensionLength().getValue()); assertArrayEquals(heartbeatMode, msg.getHeartbeatMode().getValue()); }