### Question:
NodeUpdaters { public static NodeUpdater getUpdaterFor(CloudNode node) { String nodeId = node.getId(); if (testing) { return updaterForTest; } else { synchronized (NodeUpdaters.class) { if (!updaters.containsKey(nodeId)) { NodeUpdater updater = new NodeUpdater(node); updaters.put(nodeId, updater); } } return updaters.get(nodeId); } }  static NodeUpdater getUpdaterFor(CloudNode node); static NodeUpdater updaterForTest; static boolean testing; }### Answer:
@Test public void shouldRetriveTheSameInstance() { NodeUpdater updater1 = NodeUpdaters.getUpdaterFor(node1); NodeUpdater updater2 = NodeUpdaters.getUpdaterFor(node1); assertTrue(updater1 == updater2); }
@Test public void shouldRetriveDifferentInstances() { NodeUpdater updater1 = NodeUpdaters.getUpdaterFor(node1); NodeUpdater updater2 = NodeUpdaters.getUpdaterFor(node2); assertTrue(updater1 != updater2); }