I think getPersonAttributeGroupDefinitionByName and getPersonAttributeGroupDefinitions should return IPersonAttributeGroupStoreDefinition instead of PersonAttributeGroupDefinitionImpl.