### Question:
ManageChartsForMapDialog extends CancellableDialogAdapter { public ManageChartsForMapDialog(Component owner, DpLayerVectorFeatureSource dplv, AtlasMapLegend mapLegend) { super(owner, GeopublisherGUI.R( "ManageChartsForMapDialog.TitleForDPLayer", dplv.getTitle() .toString())); this.dplv = dplv; this.atlasConfigEditable = (AtlasConfigEditable) dplv.getAtlasConfig(); this.map = mapLegend.getMap(); this.mapLegend = mapLegend; this.setVisibleChartIDs(map.getAvailableChartIDsFor(dplv.getId())); this.allChartIDs = dplv.getCharts(); backup_AvailableChartIDsFor.addAll(map.getAvailableChartIDsFor(dplv .getId())); backup_Charts.addAll(dplv.getCharts()); initGUI(); pack(); SwingUtil.setRelativeFramePosition(this, owner, SwingUtil.BOUNDS_OUTER, SwingUtil.NORTHWEST); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { if (backup_Charts.size() == 0) getAddButton().getAction().actionPerformed(null); } }); } ManageChartsForMapDialog(Component owner,
			DpLayerVectorFeatureSource dplv, AtlasMapLegend mapLegend); void cancel(); @Override boolean okClose(); JTable getChartsJTable(); void openDesignChartDialog(final FeatureChartStyle chartStyle); JButton getUpJButton(); JButton getDownJButton(); JButton getDelButton(); JButton getEditButton(); JButton getAddButton(); void setVisibleChartIDs(ArrayList<String> visibleChartIDs); ArrayList<String> getVisibleChartIDs();  }### Answer:
@Test public void testManageChartsForMapDialog() throws Throwable { Map map = null; DpLayerVectorFeatureSource dplv = null; AtlasConfigEditable ace = GpTestingUtil.getAtlasConfigE(TestAtlas.small); for (Map m : ace.getMapPool().values()) { for (DpRef<DpLayer<?, ? extends ChartStyle>> dpe : m.getLayers()) { if (dpe.getTarget() instanceof DpLayerVectorFeatureSource && dpe.getTarget().getCharts().size() > 0) { map = m; dplv = (DpLayerVectorFeatureSource) dpe.getTarget(); continue; } } if (map != null) continue; } assertNotNull("At least one vector layer with charts should be in the chart demo atlas", dplv); if (TestingUtil.INTERACTIVE) { AtlasMapLegend mapLegend = new AtlasMapLegend(new GeoMapPane(), map, ace, null); ManageChartsForMapDialog manageChartsForMapDialog = new ManageChartsForMapDialog( null, dplv, mapLegend); TestingUtil.testGui(manageChartsForMapDialog); } ace.deleteAtlas(); }