SAMLConfigFactory { public Properties getConfiguration() { if (configuration == null) { return null; } else { return (Properties) configuration.clone(); } } SAMLConfigFactory();   SAMLConfigFactory(PropertyAccessorFileUtilities propFileUtilities); static SAMLConfigFactory getInstance(); Properties getConfiguration();  }
@Test public void verifyClone() { Properties samlProperties = new Properties(); PropertyAccessorFileUtilities propFileUtil = mock(PropertyAccessorFileUtilities.class); when(propFileUtil.loadPropertyFile("saml")).thenReturn(samlProperties); SAMLConfigFactory configFactory = new SAMLConfigFactory(propFileUtil); Properties samlProp1 = configFactory.getConfiguration(); samlProp1.put("keyTest", "valueTest"); Properties samlProp2 = configFactory.getConfiguration(); assertNull(samlProp2.get("keyTest")); }