### Question:
CayenneContextGraphManager extends GraphMap { @Override public synchronized Object unregisterNode(Object nodeId) { Object node = super.unregisterNode(nodeId); if (node != null) { stateLog.unregisterNode(nodeId); changeLog.unregisterNode(nodeId); Persistent object = (Persistent)node; object.setObjectContext(null); object.setPersistenceState(PersistenceState.TRANSIENT); return node; } return null; } CayenneContextGraphManager(CayenneContext context, boolean changeEventsEnabled,
            boolean lifecycleEventsEnabled); @Override synchronized Object unregisterNode(Object nodeId); @Override synchronized void nodeIdChanged(Object nodeId, Object newId); @Override synchronized void nodeCreated(Object nodeId); @Override synchronized void nodeRemoved(Object nodeId); @Override synchronized void nodePropertyChanged(
            Object nodeId,
            String property,
            Object oldValue,
            Object newValue); @Override synchronized void arcCreated(Object nodeId, Object targetNodeId, ArcId arcId); @Override synchronized void arcDeleted(Object nodeId, Object targetNodeId, ArcId arcId);  }### Answer:
@Test public void testUnregisterNode() { ObjectId id = ObjectId.of("E1", "ID", 500); Persistent object = mock(Persistent.class); graphManager.registerNode(id, object); Object unregistered = graphManager.unregisterNode(id); assertSame(object, unregistered); verify(object, times(0)).setObjectId(null); verify(object).setObjectContext(null); verify(object).setPersistenceState(PersistenceState.TRANSIENT); }