@Test
public void testToStringCompact() {

	try {
		DistinguishedName name = new DistinguishedName("cn=john doe, ou=company");
		// First check the default
		assertThat(name.toString()).isEqualTo("cn=john doe,ou=company");
		System.setProperty(DistinguishedName.SPACED_DN_FORMAT_PROPERTY, "true");
		assertThat(name.toString()).isEqualTo("cn=john doe, ou=company");
	}
	finally {
		// Always restore the system setting
		System.setProperty(DistinguishedName.SPACED_DN_FORMAT_PROPERTY, "");
	}
}