@Test
public void testKeyCaseFoldNonsenseShoulddefaultToLowerCasedKeysAndLogWarning() throws Exception {

	try {
		String dnString = "ou=foo,Ou=bar,oU=baz,OU=bim";
		DistinguishedName name = new DistinguishedName(dnString);
		// First check the default
		assertThat(name.toString()).isEqualTo("ou=foo,ou=bar,ou=baz,ou=bim");
		
		System.setProperty(DistinguishedName.KEY_CASE_FOLD_PROPERTY, "whatever");
		name = new DistinguishedName(dnString);
		System.out.println(dnString + " folded as \"whatever\": " + name);
		assertThat(name.toString()).isEqualTo("ou=foo,ou=bar,ou=baz,ou=bim");
	}
	finally {
		// Always restore the system setting
		System.clearProperty(DistinguishedName.KEY_CASE_FOLD_PROPERTY);
	}
}