SystemPropertiesPersister { public void saveProperty(String key, String value) { if (loaded) { props.setProperty(key, value); saveProperties(props); } else { throw new AssertException("You have to load properties first!"); } } protected  SystemPropertiesPersister(File file); void saveProperty(String key, String value);  }
@Test public void testExceptionWithoutLoading() { try { propertyPersister.saveProperty("test", "test"); } catch (AssertException e) { assertNotNull(e); } }