@Test
public void testResolve_Cardinality() {

  String cardinality = "foo";
  ComponentInfo info = new ComponentInfo();
  // parent is null, child cardinality is null
  assertEquals("0+", resolveComponent(info, null).getModuleInfo().getCardinality());
  ComponentInfo parentInfo = new ComponentInfo();
  info = new ComponentInfo();
  // parent has value set, child value is null
  parentInfo.setCardinality(cardinality);
  assertEquals("foo", resolveComponent(info, parentInfo).getModuleInfo().getCardinality());
  // child has value set, parent value is null
  info.setCardinality(cardinality);
  parentInfo.setCardinality(null);
  assertEquals(cardinality, resolveComponent(info, parentInfo).getModuleInfo().getCardinality());
  // value set in both parent and child; child overwrites
  String cardinality2 = "foo2";
  info.setCardinality(cardinality2);
  parentInfo.setCardinality(cardinality);
  assertEquals(cardinality2, resolveComponent(info, parentInfo).getModuleInfo().getCardinality());
}