void () { Registry.getInstance().reset(); String firstKey = "first.key1"; String firstKeyInitValue = "first.initVal"; String firstKeyChangedVal = "first.value2"; String secondKey = "second.key"; String secondKeyInitValue = "second.initValue"; String secondKeyChangedValue = "second.initValue"; // initialize registry Registry.loadState(registryElementFromMap(new LinkedHashMap<>(){{ put(firstKey, firstKeyInitValue); put(secondKey, secondKeyInitValue); }}), null); assertEquals(firstKeyInitValue, Registry.get(firstKey).asString()); assertEquals(secondKeyInitValue, Registry.get(secondKey).asString()); // add custom values Registry.loadState(registryElementFromMap(new LinkedHashMap<>(){{ put(firstKey, firstKeyChangedVal); put(secondKey, secondKeyChangedValue); }}), null); assertEquals(firstKeyChangedVal, Registry.get(firstKey).asString()); assertEquals(secondKeyChangedValue, Registry.get(secondKey).asString()); // drop key - reset to original Registry.loadState(registryElementFromMap(new LinkedHashMap<>(){{ put(firstKey, firstKeyChangedVal); }}), null); assertEquals(firstKeyChangedVal, Registry.get(firstKey).asString()); assertEquals(secondKeyInitValue, Registry.get(secondKey).asString()); }