code: public static Map<String, Map<Table, List<String>>> analyzeJoinTable(Table table) {
          final Map<String, Map<Table, List<String>>> result = new HashMap<>();
          for (final ForeignKey fk : table.getForeignKeys()) {
  
              final String referencedTableName = fk.getColumnReferences().get(0).getPrimaryKeyColumn().getParent().getFullName();
              final Map<Table, List<String>> references = new HashMap<>();
              // Now find all others
              final List<String> otherTables = table.getForeignKeys().stream()
                      .filter(fk2 -> fk2 != fk) // exclude the current one
                      .map(fk2 -> fk2.getColumnReferences().get(0).getPrimaryKeyColumn().getParent().getFullName())
                      .collect(Collectors.toList());
              references.put(table, otherTables);
              result.put(referencedTableName, references);
          }
          return result;
      }
docs: Analyzes a join table and returns information about the foreign key relationships in this table
  <p>
  Example:<p>
  If the passed table is table ABC that is a join table for the m:n:o relation between tables A, B and C, the method will return
  </p>
  <blockquote><pre>
  - A :
  - ABC :
  - B
  - C
  - B :
  - ABC :
  - A
  - C
  - C :
  - ABC :
  - A
  - B
  </pre></blockquote>
  This information should be read as "A has a relation to B and C via the table ABC" and so on
  
  @param table The table to analyze
  @return The information about the join table. See method description for format details.