HistoryStore { public synchronized int getSize() { try { ByteArrayOutputStream bOut = new ByteArrayOutputStream(); ObjectOutputStream oOut = new ObjectOutputStream(bOut); oOut.writeObject(historyStore); bOut.close(); return bOut.size(); } catch (IOException e) { throw new IllegalStateException("Cannot serialize internal store: " + e,e); } } HistoryStore(int pTotalMaxEntries); synchronized int getGlobalMaxEntries(); synchronized void setGlobalMaxEntries(int pGlobalMaxEntries); synchronized void configure(HistoryKey pKey, HistoryLimit pHistoryLimit); synchronized void reset(); synchronized void updateAndAdd(JmxRequest pJmxReq, JSONObject pJson); synchronized int getSize();  }
@Test public void size() throws Exception { assertTrue(store.getSize() < 100); singleAttributeRead(); assertTrue(store.getSize() > 100); }