### Question:
DialPlot extends Plot implements DialLayerChangeListener { public void setDialFrame(DialFrame frame) { if (frame == null) { throw new IllegalArgumentException("Null 'frame' argument."); } this.dialFrame.removeChangeListener(this); this.dialFrame = frame; frame.addChangeListener(this); fireChangeEvent(); } DialPlot();  DialPlot(ValueDataset dataset); DialLayer getBackground(); void setBackground(DialLayer background); DialLayer getCap(); void setCap(DialLayer cap); DialFrame getDialFrame(); void setDialFrame(DialFrame frame); double getViewX(); double getViewY(); double getViewWidth(); double getViewHeight(); void setView(double x, double y, double w, double h); void addLayer(DialLayer layer); int getLayerIndex(DialLayer layer); void removeLayer(int index); void removeLayer(DialLayer layer); void addPointer(DialPointer pointer); int getPointerIndex(DialPointer pointer); void removePointer(int index); void removePointer(DialPointer pointer); DialPointer getPointerForDataset(int datasetIndex); ValueDataset getDataset(); ValueDataset getDataset(int index); void setDataset(ValueDataset dataset); void setDataset(int index, ValueDataset dataset); int getDatasetCount(); @Override void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
            PlotState parentState, PlotRenderingInfo info); double getValue(int datasetIndex); void addScale(int index, DialScale scale); DialScale getScale(int index); void mapDatasetToScale(int index, int scaleIndex); DialScale getScaleForDataset(int datasetIndex); static Rectangle2D rectangleByRadius(Rectangle2D rect,
            double radiusW, double radiusH); @Override void dialLayerChanged(DialLayerChangeEvent event); @Override boolean equals(Object obj); @Override int hashCode(); @Override String getPlotType();  }### Answer:
@Test public void testFrameListener() { DialPlot p = new DialPlot(); ArcDialFrame f1 = new ArcDialFrame(); p.setDialFrame(f1); p.addChangeListener(this); this.lastEvent = null; f1.setBackgroundPaint(Color.gray); assertNotNull(this.lastEvent); ArcDialFrame f2 = new ArcDialFrame(); p.setDialFrame(f2); this.lastEvent = null; f1.setBackgroundPaint(Color.BLUE); assertNull(this.lastEvent); f2.setBackgroundPaint(Color.green); assertNotNull(this.lastEvent); }