PWDProtectExtensionParser extends ExtensionParser<PWDProtectExtensionMessage> { @Override public void parseExtensionMessageContent(PWDProtectExtensionMessage msg) { LOGGER.debug("Parsing PWDProtectExtensionMessage"); parseUsernameLength(msg); parseUsername(msg); } PWDProtectExtensionParser(int startposition, byte[] array); @Override void parseExtensionMessageContent(PWDProtectExtensionMessage msg);  }
@Test public void testParseExtensionMessageContent() { PWDProtectExtensionParser parser = new PWDProtectExtensionParser(start, expectedBytes); PWDProtectExtensionMessage msg = parser.parse(); assertArrayEquals(type.getValue(), msg.getExtensionType().getValue()); assertEquals(extensionLength, (long) msg.getExtensionLength().getValue()); assertEquals(usernameLength, (long) msg.getUsernameLength().getValue()); assertArrayEquals(username, msg.getUsername().getValue()); }