### Question:
SimpleFeatureActionController { public void copy() { FeatureAction act = myAction.getFeatureAction(); FeatureAction copied = XMLUtilities.jaxbClone(act, FeatureAction.class); if (Utilities.sameInstance(copied, act)) { return; } copied.setName(copied.getName() + " Copy"); SimpleFeatureAction simpleCopy = new SimpleFeatureAction(copied); myGroup.getActions().add(simpleCopy); } SimpleFeatureActionController(DataTypeController typeController, SimpleFeatureActions actions,
            SimpleFeatureActionGroup group, SimpleFeatureAction action); void copy(); void remove();  }### Answer:
@Test public void testCopy() { EasyMockSupport support = new EasyMockSupport(); DataTypeController typeController = createTypeController(support); support.replayAll(); FeatureAction action = new FeatureAction(); action.setName("Action 1"); action.setEnabled(true); StyleAction styleAction = new StyleAction(); styleAction.getStyleOptions().setColor(Color.CYAN); styleAction.getStyleOptions().setIconId(22); action.getActions().add(styleAction); SimpleFeatureActionGroup group = new SimpleFeatureActionGroup(); SimpleFeatureAction simpleAction = new SimpleFeatureAction(action); group.getActions().add(simpleAction); Filter filter = new Filter(); Group filterGroup = new Group(); filterGroup.getCriteria().add(new Criteria("USER NAME", Conditional.LIKE, "B*")); filter.setFilterGroup(filterGroup); action.setFilter(filter); SimpleFeatureActions actions = new SimpleFeatureActions(ourLayerId); actions.getFeatureGroups().add(group); SimpleFeatureActionGroupAdapter adapter = new SimpleFeatureActionGroupAdapter(group); SimpleFeatureActionController controller = new SimpleFeatureActionController(typeController, actions, group, simpleAction); controller.copy(); assertEquals(2, group.getActions().size()); SimpleFeatureAction copied = group.getActions().get(1); assertEquals("Action 1 Copy", copied.getFeatureAction().getName()); assertTrue(copied.getFeatureAction().isEnabled()); assertEquals(FXUtilities.fromAwtColor(Color.CYAN), copied.getColor()); assertEquals(22, copied.getIconId()); assertEquals("USER NAME", copied.getColumn().get()); assertEquals(CriteriaOptions.VALUE, copied.getOption().get()); assertEquals("B*", copied.getValue().get()); adapter.close(); support.verifyAll(); }