### Question:
LdapConnectionConfig { public void setTrustManagers( TrustManager... trustManagers ) { if ( ( trustManagers == null ) || ( trustManagers.length == 0 ) || ( trustManagers.length == 1 && trustManagers[0] == null ) ) { throw new IllegalArgumentException( "TrustManagers must not be null or empty" ); } this.trustManagers = trustManagers; } LdapConnectionConfig(); boolean isUseSsl(); void setUseSsl( boolean useSsl ); int getLdapPort(); void setLdapPort( int ldapPort ); String getLdapHost(); void setLdapHost( String ldapHost ); String getName(); void setName( String name ); String getCredentials(); void setCredentials( String credentials ); int getDefaultLdapPort(); int getDefaultLdapsPort(); String getDefaultLdapHost(); long getDefaultTimeout(); long getTimeout(); void setTimeout( long timeout ); int getSupportedLdapVersion(); TrustManager[] getTrustManagers(); void setTrustManagers( TrustManager... trustManagers ); String getSslProtocol(); void setSslProtocol( String sslProtocol ); KeyManager[] getKeyManagers(); void setKeyManagers( KeyManager[] keyManagers ); SecureRandom getSecureRandom(); void setSecureRandom( SecureRandom secureRandom ); String[] getEnabledCipherSuites(); void setEnabledCipherSuites( String[] enabledCipherSuites ); String[] getEnabledProtocols(); void setEnabledProtocols( String... enabledProtocols ); BinaryAttributeDetector getBinaryAttributeDetector(); void setBinaryAttributeDetector( BinaryAttributeDetector binaryAttributeDetector ); boolean isUseTls(); void setUseTls( boolean useTls ); LdapApiService getLdapApiService(); void setLdapApiService( LdapApiService ldapApiService ); static final int DEFAULT_LDAP_PORT; static final int DEFAULT_LDAPS_PORT; static final String DEFAULT_LDAP_HOST; static final int LDAP_V3; static final long DEFAULT_TIMEOUT; static final String DEFAULT_SSL_PROTOCOL; }### Answer:
@Test public void testNullTrustManagers() { LdapConnectionConfig config = new LdapConnectionConfig(); Assertions.assertThrows(IllegalArgumentException.class, () -> { config.setTrustManagers((TrustManager)null); }); }
@Test public void testNullTrustManagers2() { LdapConnectionConfig config = new LdapConnectionConfig(); Assertions.assertThrows(IllegalArgumentException.class, () -> { config.setTrustManagers(null); }); }