DefaultContainerCascade implements ContainerCascade { @Override public void colorNode(String nodeId, RGBColor fillColor, RGBColor borderColor) { for (IdentifiedPolygon node : nodes) { if (node.id.equals(nodeId)) { node.element.setBorderColor(borderColor); node.element.fill(fillColor); node.element.setAlpha(fillColor.alpha); } } }  void add(final IdentifiedPolygon node); void add(FlexibleArrow element); @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); @Override boolean hasNode(String nodeId); void moveBy(double x, double y);  }
@Test public void fillsNodeWithId() throws Exception { container.colorNode("X", RGBColor.Blue, RGBColor.Black); verify(polygon1).fill(RGBColor.Blue); }
@Test public void doesNotFillNodeWithDifferentId() throws Exception { container.colorNode("Y", RGBColor.Blue, RGBColor.Black); verify(polygon1, never()).fill(Matchers.any(RGBColor.class)); }
@Test public void alphasNodeWithId() throws Exception { container.colorNode("X", new RGBColor(Black, 111), RGBColor.Black); verify(polygon1).setAlpha(111); }
@Test public void doesNotAlphaNodeWithDifferentId() throws Exception { container.colorNode("Y", new RGBColor(Black, 111), RGBColor.Black); verify(polygon1, never()).setAlpha(anyInt()); }