### Question:
PersistentServerState { PersistentServerState(DN baseDN, int serverId, ServerState state) { this.baseDN = baseDN; this.serverId = serverId; this.state = state; loadState(); } PersistentServerState(DN baseDN, int serverId, ServerState state); void save(); void loadState(); void clearInMemory(); CSN getMaxCSN(int serverId); @Override String toString();  }### Answer:
@Test(dataProvider = "suffix") public void persistentServerStateTest(String dn) throws Exception { DN baseDn = DN.valueOf(dn); ServerState origState = new ServerState(); PersistentServerState state = new PersistentServerState(baseDn, 1, origState); CSNGenerator gen1 = new CSNGenerator(1, origState); CSNGenerator gen2 = new CSNGenerator(2, origState); CSN csn1 = gen1.newCSN(); CSN csn2 = gen2.newCSN(); assertEquals(state.update(csn1), true); assertEquals(state.update(csn2), true); state.save(); PersistentServerState stateSaved = new PersistentServerState(baseDn, 1, new ServerState()); CSN csn1Saved = stateSaved.getMaxCSN(1); CSN csn2Saved = stateSaved.getMaxCSN(2); assertEquals(csn1Saved, csn1, "csn1 has not been saved or loaded correctly for " + dn); assertEquals(csn2Saved, csn2, "csn2 has not been saved or loaded correctly for " + dn); state.clear(); stateSaved = new PersistentServerState(baseDn, 1, new ServerState()); csn1Saved = stateSaved.getMaxCSN(1); assertNull(csn1Saved, "csn1 has not been saved after clear for " + dn); }