@Test
  public void testSpringCreation()
      throws JaloInvalidParameterException, JaloDuplicateCodeException,
          JaloGenericCreationException, JaloAbstractTypeException {
    final ComposedType unitType = TypeManager.getInstance().getComposedType(Unit.class);
    final ComposedType ct = TypeManager.getInstance().createComposedType(unitType, "MyUnit");
    ct.setJaloClass(MyUnit.class);

    final Map<String, Object> params = new HashMap<String, Object>();
    params.put(Unit.CODE, "code");
    params.put(Unit.UNITTYPE, "type");

    final MyUnit u = (MyUnit) ct.newInstance(params);

    assertEquals("<code>", u.getCode());
    assertEquals("type", u.getUnitType());
    assertTrue(u instanceof MySpringUnit);

    params.clear();
    params.put(Unit.CODE, "code2");
    params.put(Unit.UNITTYPE, "type");

    final Unit controlUnit = (Unit) unitType.newInstance(params);

    assertEquals("code2", controlUnit.getCode());
    assertEquals("type", controlUnit.getUnitType());
    assertFalse(controlUnit instanceof MyUnit);
  }
 private Product createProduct(final String code, final ComposedType composedType)
     throws JaloGenericCreationException, JaloAbstractTypeException {
   final Map args = new HashMap();
   args.put(Product.CODE, code);
   args.put(CatalogConstants.Attributes.Product.CATALOGVERSION, srcCatalogVersion);
   return (Product) composedType.newInstance(args);
 }