@Test public void testRun() throws ArgumentParserException { act.run(null, arg, attrs, null, null); assertEquals(singletonList("const"), attrs.get("dest")); act.run(null, arg, attrs, null, null); assertEquals(Arrays.asList("const", "const"), attrs.get("dest")); }
@Override public void run(ArgumentParser parser, Argument arg, Map<String, Object> attrs, String flag, Object value) throws ArgumentParserException { if (attrs.containsKey(arg.getDest())) { Object obj = attrs.get(arg.getDest()); if (obj instanceof List) { ((List<Object>) obj).add(arg.getConst()); return; } } List<Object> list = new ArrayList<Object>(); list.add(arg.getConst()); attrs.put(arg.getDest(), list); }
AppendConstArgumentAction implements ArgumentAction { @Override public void run(ArgumentParser parser, Argument arg, Map<String, Object> attrs, String flag, Object value) throws ArgumentParserException { if (attrs.containsKey(arg.getDest())) { Object obj = attrs.get(arg.getDest()); if (obj instanceof List) { ((List<Object>) obj).add(arg.getConst()); return; } } List<Object> list = new ArrayList<Object>(); list.add(arg.getConst()); attrs.put(arg.getDest(), list); } }
AppendConstArgumentAction implements ArgumentAction { @Override public void run(ArgumentParser parser, Argument arg, Map<String, Object> attrs, String flag, Object value) throws ArgumentParserException { if (attrs.containsKey(arg.getDest())) { Object obj = attrs.get(arg.getDest()); if (obj instanceof List) { ((List<Object>) obj).add(arg.getConst()); return; } } List<Object> list = new ArrayList<Object>(); list.add(arg.getConst()); attrs.put(arg.getDest(), list); }  }
AppendConstArgumentAction implements ArgumentAction { @Override public void run(ArgumentParser parser, Argument arg, Map<String, Object> attrs, String flag, Object value) throws ArgumentParserException { if (attrs.containsKey(arg.getDest())) { Object obj = attrs.get(arg.getDest()); if (obj instanceof List) { ((List<Object>) obj).add(arg.getConst()); return; } } List<Object> list = new ArrayList<Object>(); list.add(arg.getConst()); attrs.put(arg.getDest(), list); }  @Override void run(ArgumentParser parser, Argument arg,
            Map<String, Object> attrs, String flag, Object value); @Override boolean consumeArgument(); @Override void onAttach(Argument arg); }
AppendConstArgumentAction implements ArgumentAction { @Override public void run(ArgumentParser parser, Argument arg, Map<String, Object> attrs, String flag, Object value) throws ArgumentParserException { if (attrs.containsKey(arg.getDest())) { Object obj = attrs.get(arg.getDest()); if (obj instanceof List) { ((List<Object>) obj).add(arg.getConst()); return; } } List<Object> list = new ArrayList<Object>(); list.add(arg.getConst()); attrs.put(arg.getDest(), list); }  @Override void run(ArgumentParser parser, Argument arg,
            Map<String, Object> attrs, String flag, Object value); @Override boolean consumeArgument(); @Override void onAttach(Argument arg);  }