### Question:
GraphMap implements GraphManager { @Override public Collection<Object> registeredNodes() { return Collections.unmodifiableCollection(nodes.values()); } GraphMap(); @Override Collection<Object> registeredNodes(); @Override synchronized Object getNode(Object nodeId); @Override synchronized void registerNode(Object nodeId, Object nodeObject); @Override synchronized Object unregisterNode(Object nodeId); @Override void arcCreated(Object nodeId, Object targetNodeId, ArcId arcId); @Override void arcDeleted(Object nodeId, Object targetNodeId, ArcId arcId); @Override void nodeCreated(Object nodeId); @Override void nodeRemoved(Object nodeId); @Override void nodeIdChanged(Object nodeId, Object newId); @Override void nodePropertyChanged(
            Object nodeId,
            String property,
            Object oldValue,
            Object newValue);  }### Answer:
@Test public void testRegisteredNodes() { GraphMap map = new GraphMap(); Object n1 = new Object(); Object n2 = new Object(); map.registerNode(n1, n1); map.registerNode(n2, n2); Collection nodes = map.registeredNodes(); assertNotNull(nodes); assertEquals(2, nodes.size()); assertTrue(nodes.contains(n1)); assertTrue(nodes.contains(n2)); try { nodes.add(new Object()); fail("Nodes collection is expected to be immutable."); } catch (UnsupportedOperationException e) { } }