AbstractConfig implements Serializable { protected static void appendAttributes(Map<Object, Object> parameters, Object config) { appendAttributes(parameters, config, null); }  @Parameter(excluded = true) String getId(); void setId(String id); @Override String toString();  }
@Test public void testAppendAttributes1() throws Exception { Map<Object, Object> parameters = new HashMap<Object, Object>(); AbstractConfig.appendAttributes(parameters, new AttributeConfig('l', true, (byte) 0x01), "prefix"); TestCase.assertEquals('l', parameters.get("prefix.let")); TestCase.assertEquals(true, parameters.get("prefix.activate")); TestCase.assertFalse(parameters.containsKey("prefix.flag")); }
@Test public void testAppendAttributes2() throws Exception { Map<Object, Object> parameters = new HashMap<Object, Object>(); AbstractConfig.appendAttributes(parameters, new AttributeConfig('l', true, (byte) 0x01)); TestCase.assertEquals('l', parameters.get("let")); TestCase.assertEquals(true, parameters.get("activate")); TestCase.assertFalse(parameters.containsKey("flag")); }