code: private int countRelations(String relationName, Set<RelationshipTuple> objectRelations) {
  
          int count = 0;
          if (objectRelations == null) {
              return 0;
          }
          for (RelationshipTuple objectRelation : objectRelations) {
              if (objectRelation.predicate.equals(relationName)) {//This is one of the restricted relations
                  count++;
              }
  
          }
          return count;
      }
docs: Private utility method. Counts the number of relations with a given name in a list of relatiosn
  
  @param relationName    the relation name
  @param objectRelations the list of relations
  @return the number of relations with relationName in the list