### Question:
SVGViewUtils { public static void switchVisibility(final SVGShapeView<?> view, final String visibleId, final String nonVisibleId) { getPrimitive(view, visibleId) .ifPresent(prim -> prim.get().setAlpha(1)); getPrimitive(view, nonVisibleId) .ifPresent(prim -> prim.get().setAlpha(0)); }  static void switchVisibility(final SVGShapeView<?> view,
                                        final String visibleId,
                                        final String nonVisibleId); @SuppressWarnings("unchecked") static V getVisibleShape(final ShapeView<?>... views); static Optional<SVGPrimitive> getPrimitive(final SVGShapeView<?> view,
                                                      final String id); static SVGPrimitive getPrimitive(final SVGContainer container,
                                            final String id); static SVGPrimitive getPrimitive(final Collection<SVGPrimitive<?>> primitives,
                                            final String id); static SVGPrimitive getPrimitive(final SVGPrimitive<?> primitive,
                                            final String id); static void setFillAndStroke(final SVGShapeView<?> view, final String id, final double fill, final double stroke);  }### Answer:
@Test public void testSwitchVisibilityP1P2() { SVGViewUtils.switchVisibility(svgShape, "p1", "p2"); verify(p1, times(1)).setAlpha(1d); verify(p2, times(1)).setAlpha(0d); }
@Test public void testSwitchVisibilityP2P1() { SVGViewUtils.switchVisibility(svgShape, "p2", "p1"); verify(p1, times(1)).setAlpha(0d); verify(p2, times(1)).setAlpha(1d); }