### Question:
OpenSslKeyMaterialManager { void setKeyMaterialClientSide(ReferenceCountedOpenSslEngine engine, String[] keyTypes, X500Principal[] issuer) throws SSLException { String alias = chooseClientAlias(engine, keyTypes, issuer); if (alias != null) { setKeyMaterial(engine, alias); } } OpenSslKeyMaterialManager(OpenSslKeyMaterialProvider provider);   }### Answer:
@Test public void testChooseClientAliasReturnsNull() throws SSLException { Assume.assumeTrue(OpenSsl.isAvailable()); X509ExtendedKeyManager keyManager = new X509ExtendedKeyManager() { @Override public String[] getClientAliases(String s, Principal[] principals) { return EmptyArrays.EMPTY_STRINGS; } @Override public String chooseClientAlias(String[] strings, Principal[] principals, Socket socket) { return null; } @Override public String[] getServerAliases(String s, Principal[] principals) { return EmptyArrays.EMPTY_STRINGS; } @Override public String chooseServerAlias(String s, Principal[] principals, Socket socket) { return null; } @Override public X509Certificate[] getCertificateChain(String s) { return EmptyArrays.EMPTY_X509_CERTIFICATES; } @Override public PrivateKey getPrivateKey(String s) { return null; } }; OpenSslKeyMaterialManager manager = new OpenSslKeyMaterialManager( new OpenSslKeyMaterialProvider(keyManager, null) { @Override OpenSslKeyMaterial chooseKeyMaterial(ByteBufAllocator allocator, String alias) throws Exception { Assert.fail("Should not be called when alias is null"); return null; } }); SslContext context = SslContextBuilder.forClient().sslProvider(SslProvider.OPENSSL).build(); OpenSslEngine engine = (OpenSslEngine) context.newEngine(UnpooledByteBufAllocator.DEFAULT); manager.setKeyMaterialClientSide(engine, EmptyArrays.EMPTY_STRINGS, null); }