### Question:
Zoom extends Modem { @Override public void accept(ModemVisitor modemVisitor) { if (modemVisitor instanceof ZoomVisitor) { ((ZoomVisitor) modemVisitor).visit(this); } else { LOGGER.info("Only ZoomVisitor is allowed to visit Zoom modem"); } }  @Override void accept(ModemVisitor modemVisitor); @Override String toString();  }### Answer:
@Test public void testAcceptForDos() { Zoom zoom = new Zoom(); ConfigureForDosVisitor mockVisitor = mock(ConfigureForDosVisitor.class); zoom.accept(mockVisitor); verify((ZoomVisitor)mockVisitor).visit(eq(zoom)); }
@Test public void testAcceptForUnix() { Zoom zoom = new Zoom(); ConfigureForUnixVisitor mockVisitor = mock(ConfigureForUnixVisitor.class); zoom.accept(mockVisitor); verify((ZoomVisitor)mockVisitor).visit(eq(zoom)); }
@Test public void testAcceptForDos() { var zoom = new Zoom(); var mockVisitor = mock(ConfigureForDosVisitor.class); zoom.accept(mockVisitor); verify((ZoomVisitor)mockVisitor).visit(eq(zoom)); }
@Test public void testAcceptForUnix() { var zoom = new Zoom(); var mockVisitor = mock(ConfigureForUnixVisitor.class); zoom.accept(mockVisitor); verify((ZoomVisitor)mockVisitor).visit(eq(zoom)); }