Source:
public void configure(LdapDetails<T> ldapDetails) { ldapServer.set(ldapDetails.getHostWithPort()); if(this.version116) { advancedServer.click(); } else { advanced.click(); } rootDn.set(ldapDetails.getRootDn()); managerDn.set(ldapDetails.getManagerDn()); managerPassword.set(ldapDetails.getManagerPassword()); userSearchBase.set(ldapDetails.getUserSearchBase()); userSearchFilter.set(ldapDetails.getUserSearchFilter()); groupSearchBase.set(ldapDetails.getGroupSearchBase()); groupSearchFilter.set(ldapDetails.getGroupSearchFilter()); configureGroupMembership(ldapDetails); if(this.version116) { advanced.click(); } disableLdapEmailResolver.check(ldapDetails.isDisableLdapEmailResolver()); if (ldapDetails.isEnableCache()) { enableCache.check(true); control("cache/size").select(String.valueOf(ldapDetails.getCacheSize())); control("cache/ttl").select(String.valueOf(ldapDetails.getCacheTTL())); } if (ldapDetails.getDisplayNameAttributeName() != null) { displayNameAttributeName.set(ldapDetails.getDisplayNameAttributeName()); } if (ldapDetails.getMailAddressAttributeName() != null) { mailAddressAttributeName.set(ldapDetails.getMailAddressAttributeName()); } if (ldapDetails.getEnvironmentVariables() != null && !ldapDetails.getEnvironmentVariables().isEmpty()) { int i = 0; String envVarSelector; for (LdapEnvironmentVariable envVariable : ldapDetails.getEnvironmentVariables()) { addEnvVariableButton.click(); envVarSelector = i == 0 ? "" : "[" + i + "]"; control("/environmentProperties" + envVarSelector + "/name").set(envVariable.getName()); control("/environmentProperties" + envVarSelector + "/value").set(envVariable.getValue()); i++; } } }

Target:
public void configure(LdapDetails<T> ldapDetails) { ldapServer.set(ldapDetails.getHostWithPort()); advancedServer.click(); rootDn.set(ldapDetails.getRootDn()); managerDn.set(ldapDetails.getManagerDn()); managerPassword.set(ldapDetails.getManagerPassword()); userSearchBase.set(ldapDetails.getUserSearchBase()); userSearchFilter.set(ldapDetails.getUserSearchFilter()); groupSearchBase.set(ldapDetails.getGroupSearchBase()); groupSearchFilter.set(ldapDetails.getGroupSearchFilter()); configureGroupMembership(ldapDetails); if (this.sinceVersion116) { advanced.click(); } disableLdapEmailResolver.check(ldapDetails.isDisableLdapEmailResolver()); if (ldapDetails.isEnableCache()) { enableCache.check(true); control("cache/size").select(String.valueOf(ldapDetails.getCacheSize())); control("cache/ttl").select(String.valueOf(ldapDetails.getCacheTTL())); } if (ldapDetails.getDisplayNameAttributeName() != null) { displayNameAttributeName.set(ldapDetails.getDisplayNameAttributeName()); } if (ldapDetails.getMailAddressAttributeName() != null) { mailAddressAttributeName.set(ldapDetails.getMailAddressAttributeName()); } if (ldapDetails.getEnvironmentVariables() != null && !ldapDetails.getEnvironmentVariables().isEmpty()) { int i = 0; String envVarSelector; for (LdapEnvironmentVariable envVariable : ldapDetails.getEnvironmentVariables()) { addEnvVariableButton.click(); envVarSelector = i == 0 ? "" : "[" + i + "]"; control("configurations/environmentProperties" + envVarSelector + "/name" , "/environmentProperties" + envVarSelector + "/name").set(envVariable.getName()); control("configurations/environmentProperties" + envVarSelector + "/value" , "/environmentProperties" + envVarSelector + "/value").set(envVariable.getValue()); i++; } } }