code: private static void checkRelationAliasesConsistency(RAExpressionAttributes re1,
                                                          RAExpressionAttributes re2) throws IllegalJoinException {
  
          ImmutableSet<RelationID> alias1 = re1.attributes.keySet().stream()
                  .filter(id -> id.getRelation() != null)
                  .map(QualifiedAttributeID::getRelation).collect(ImmutableCollectors.toSet());
  
          ImmutableSet<RelationID> alias2 = re2.attributes.keySet().stream()
                  .filter(id -> id.getRelation() != null)
                  .map(QualifiedAttributeID::getRelation).collect(ImmutableCollectors.toSet());
  
          if (alias1.stream().anyMatch(alias2::contains))
              throw new IllegalJoinException(re1, re2 ,"Relation alias " +
                      alias1.stream().filter(alias2::contains).collect(ImmutableCollectors.toList()) +
                      " occurs in both arguments of the JOIN");
      }
docs: throw IllegalJoinException if a relation alias occurs in both arguments of the join
  
  @param re1 a {@link RAExpressionAttributes}
  @param re2 a {@link RAExpressionAttributes}
  @throws IllegalJoinException if the same alias occurs in both arguments