static void validateOwnAttributes(EntityType entityType) {
    // Validate that entity has attributes
    if (stream(entityType.getAllAttributes()).collect(toList()).isEmpty()) {
      throw new MolgenisValidationException(
          new ConstraintViolation(
              format(
                  "EntityType [%s] does not contain any attributes. Did you use the correct package+entity name combination in both the entities as well as the attributes sheet?",
                  entityType.getId())));
    }

    // Validate that entity does not contain multiple attributes with the same name
    Multimap<String, Attribute> attrMultiMap =
        stream(entityType.getAllAttributes())
            .collect(
                MultimapCollectors.toArrayListMultimap(Attribute::getName, Function.identity()));
    attrMultiMap
        .keySet()
        .forEach(
            attrName -> {
              if (attrMultiMap.get(attrName).size() > 1) {
                throw new MolgenisValidationException(
                    new ConstraintViolation(
                        format(
                            "EntityType [%s] contains multiple attributes with name [%s]",
                            entityType.getId(), attrName)));
              }
            });
  }
static void validateOwnAttributes ( EntityType entityType ) { if ( stream ( entityType . getAllAttributes ( ) ) . collect ( toList ( ) ) . isEmpty ( ) ) { throw new MolgenisValidationException ( new ConstraintViolation ( format ( "EntityType [%s] does not contain any attributes. Did you use the correct package+entity name combination in both the entities as well as the attributes sheet?" , entityType . getId ( ) ) ) ) ; } Multimap < String , Attribute > attrMultiMap = stream ( entityType . getAllAttributes ( ) ) . collect ( MultimapCollectors . toArrayListMultimap ( Attribute :: getName , Function . identity ( ) ) ) ; attrMultiMap . keySet ( ) . forEach ( attrName -> { if ( attrMultiMap . get ( attrName ) . size ( ) > 1 ) { throw new MolgenisValidationException ( new ConstraintViolation ( format ( "EntityType [%s] contains multiple attributes with name [%s]" , entityType . getId ( ) , attrName ) ) ) ; } } ) ; }
Validates the attributes owned by this entity: 1) validates that the parent entity doesn't have
attributes with the same name 2) validates that this entity doesn't have attributes with the
same name 3) validates that this entity has attributes defined at all

@param entityType entity meta data
@throws MolgenisValidationException if an attribute is owned by another entity or a parent
attribute has the same name