ClientCertificateTypeExtensionParser extends ExtensionParser<ClientCertificateTypeExtensionMessage> { @Override public void parseExtensionMessageContent(ClientCertificateTypeExtensionMessage msg) { if (msg.getExtensionLength().getValue() != 1) { msg.setCertificateTypesLength(parseIntField(ExtensionByteLength.CERTIFICATE_TYPE_TYPE_LENGTH)); msg.setCertificateTypes(parseByteArrayField(msg.getCertificateTypesLength().getValue())); } else { msg.setCertificateTypes(parseByteArrayField(ExtensionByteLength.CERTIFICATE_TYPE_TYPE_LENGTH)); } } ClientCertificateTypeExtensionParser(int startposition, byte[] array); @Override void parseExtensionMessageContent(ClientCertificateTypeExtensionMessage msg);  }
@Test public void testParseExtensionMessageContent() { msg = parser.parse(); assertArrayEquals(extensionType.getValue(), msg.getExtensionType().getValue()); assertEquals(extensionLength, (long) msg.getExtensionLength().getValue()); if (certificateTypesLength != null) { assertEquals(certificateTypesLength, msg.getCertificateTypesLength().getValue()); } else { assertNull(msg.getCertificateTypesLength()); } assertArrayEquals(CertificateType.toByteArray(certificateTypes), msg.getCertificateTypes().getValue()); }