AggregatedCascade implements Cascade { @Override public void colorNode(String nodeId, RGBColor fillColor, RGBColor borderColor) { for (ContainerCascade cascade : cascades) { if (cascade.hasNode(nodeId)) { cascade.colorNode(nodeId, fillColor, borderColor); } } }  @Override void colorNode(String nodeId, RGBColor fillColor, RGBColor borderColor); @Override void addTo(PolygonPanel panel); @Override void addToggleListener(NodeToggleListener listener); @Override void removeToggleListener(NodeToggleListener listener); @Override void initNodeNames(NodePresentationProperties properties); @Override void determinePositionFor(String nodeId, ShapeWithPosition control); void add(ContainerCascade cascade);  }
@Test public void forwardsColoringToContainer() throws Exception { when(child.hasNode("X")).thenReturn(true); cascade.colorNode("X", RGBColor.Pink, RGBColor.Black); verify(child).colorNode("X", RGBColor.Pink, RGBColor.Black); }
@Test public void doesNotForwardColoringToDifferentChild() throws Exception { cascade.colorNode("X", RGBColor.Pink, RGBColor.Black); verify(child, never()).colorNode("X", RGBColor.Pink, RGBColor.Black); }