/** @see org.jasig.portal.groups.IEntityStore#newInstance(java.lang.String, java.lang.Class) */
 @SuppressWarnings("unchecked")
 public IEntity newInstance(String key, Class type) throws GroupsException {
   if (org.jasig.portal.EntityTypes.getEntityTypeID(type) == null) {
     throw new GroupsException("Invalid group type: " + type);
   }
   return new EntityImpl(key, type);
 }
 @Override
 public IEntity newInstance(String key, Class type) throws GroupsException {
   /*
    * NOTE:  It seems like something should be done to prevent emitting
    * nonsense entities;  it's not clear what that would be.
    */
   if (EntityTypes.getEntityTypeID(type) == null) {
     throw new GroupsException("Invalid entity type: " + type.getName());
   }
   return new EntityImpl(key, type);
 }