### Question:
DefaultPluginPersistentState implements Serializable, PluginPersistentState { public PluginRestartState getPluginRestartState(final String pluginKey) { for (final PluginRestartState state : PluginRestartState.values()) { if (map.containsKey(buildStateKey(pluginKey, state))) { return state; } } return PluginRestartState.NONE; } @Deprecated  DefaultPluginPersistentState(); @Deprecated  DefaultPluginPersistentState(final Map<String, Boolean> map);   DefaultPluginPersistentState(final Map<String, Boolean> map, final boolean ignore); @Deprecated  DefaultPluginPersistentState(final PluginPersistentState state); Map<String, Boolean> getMap(); boolean isEnabled(final Plugin plugin); boolean isEnabled(final ModuleDescriptor<?> pluginModule); Map<String, Boolean> getPluginStateMap(final Plugin plugin); PluginRestartState getPluginRestartState(final String pluginKey);  }### Answer:
@Test public void testPluginRestartStateRemoveExisting() { final PluginPersistentState.Builder builder = PluginPersistentState.Builder.create(); builder.setPluginRestartState("foo", PluginRestartState.UPGRADE); assertEquals(PluginRestartState.UPGRADE, builder.toState().getPluginRestartState("foo")); builder.setPluginRestartState("foo", PluginRestartState.REMOVE); assertEquals(PluginRestartState.REMOVE, builder.toState().getPluginRestartState("foo")); }