@Test
public void testResolve_CustomCommands() throws Exception {

  List<CustomCommandDefinition> commands = new ArrayList<CustomCommandDefinition>();
  CustomCommandDefinition command1 = new CustomCommandDefinition();
  setPrivateField(command1, "name", "one");
  CustomCommandDefinition command2 = new CustomCommandDefinition();
  setPrivateField(command2, "name", "two");
  commands.add(command1);
  commands.add(command2);
  ComponentInfo info = new ComponentInfo();
  ComponentInfo parentInfo = new ComponentInfo();
  // parent has value set, child value is null
  parentInfo.setCustomCommands(commands);
  assertEquals(commands, resolveComponent(info, parentInfo).getModuleInfo().getCustomCommands());
  // child has value set, parent value is null
  info.setCustomCommands(commands);
  parentInfo.setCustomCommands(null);
  assertEquals(commands, resolveComponent(info, parentInfo).getModuleInfo().getCustomCommands());
  // value set in both parent and child; merge parent and child
  //todo: currently there is no way to remove an inherited command
  List<CustomCommandDefinition> commands2 = new ArrayList<CustomCommandDefinition>();
  CustomCommandDefinition command3 = new CustomCommandDefinition();
  // override command 2
  setPrivateField(command3, "name", "two");
  CustomCommandDefinition command4 = new CustomCommandDefinition();
  setPrivateField(command4, "name", "four");
  commands2.add(command3);
  commands2.add(command4);
  info.setCustomCommands(commands2);
  parentInfo.setCustomCommands(commands);
  List<CustomCommandDefinition> resolvedCommands = resolveComponent(info, parentInfo).getModuleInfo().getCustomCommands();
  assertEquals(3, resolvedCommands.size());
  assertTrue(resolvedCommands.contains(command1));
  assertTrue(resolvedCommands.contains(command3));
  assertTrue(resolvedCommands.contains(command4));
}