SupportedVersionsExtensionParser extends ExtensionParser<SupportedVersionsExtensionMessage> { @Override public void parseExtensionMessageContent(SupportedVersionsExtensionMessage msg) { LOGGER.debug("Parsing SupportedVersionsExtensionMessage"); if (msg.getExtensionLength().getValue() == HandshakeByteLength.VERSION) { msg.setSupportedVersions(parseByteArrayField(HandshakeByteLength.VERSION)); } else { parseSupportedVersionLength(msg); parseSupportedVersion(msg); } } SupportedVersionsExtensionParser(int startposition, byte[] array); @Override void parseExtensionMessageContent(SupportedVersionsExtensionMessage msg);  }
@Test public void testParseExtensionMessageContent() { SupportedVersionsExtensionParser parser = new SupportedVersionsExtensionParser(start, extension); SupportedVersionsExtensionMessage msg = parser.parse(); assertArrayEquals(msg.getExtensionBytes().getValue(), completeExtension); assertArrayEquals(type.getValue(), msg.getExtensionType().getValue()); assertTrue(extensionLength == msg.getExtensionLength().getValue()); assertArrayEquals(msg.getSupportedVersions().getValue(), versionList); assertTrue(versionListLength == msg.getSupportedVersionsLength().getValue()); }