@Test public void testMemoryState() throws Exception { MemoryState fc = new MemoryState(); MyObject testObject = new MyObject(); testObject.setaField("bye"); fc.put("test1", testObject); MyObject resObject = fc.get("test1", MyObject.class); assertNotSame(testObject, resObject); assertEquals(testObject.getaField(), resObject.getaField()); }