@Test
void testEqualTables() throws AlgorithmExecutionException {

    // GIVEN
    ColumnIdentifier a1 = new ColumnIdentifier("R", "A1");
    ColumnIdentifier a2 = new ColumnIdentifier("R", "A2");
    ColumnIdentifier a3 = new ColumnIdentifier("R", "A3");
    ColumnIdentifier b1 = new ColumnIdentifier("S", "B1");
    ColumnIdentifier b2 = new ColumnIdentifier("S", "B2");
    ColumnIdentifier b3 = new ColumnIdentifier("S", "B3");
    TableInputGenerator tableRGenerator = mock(TableInputGenerator.class);
    TableInputGenerator tableSGenerator = mock(TableInputGenerator.class);
    RelationalInputGenerator tableR = RelationalInputGeneratorStub.builder()
            .relationName("R")
            .columnNames(ImmutableList.of(INDEX_COLUMN, "A1", "A2", "A3"))
            .rows(ImmutableList.of(
                    Row.of("1", "a", "b", "c"),
                    Row.of("2", "d", "e", "f")))
            .build();
    RelationalInputGenerator tableS = RelationalInputGeneratorStub.builder()
            .relationName("S")
            .columnNames(ImmutableList.of(INDEX_COLUMN, "B1", "B2", "B3"))
            .rows(ImmutableList.of(
                    Row.of("1", "a", "b", "c"),
                    Row.of("2", "d", "e", "f")))
            .build();
    ImmutableSet<InclusionDependency> unaryInds = ImmutableSet.of(
            toInd(a1, b1), toInd(a2, b2), toInd(a3, b3));
    ImmutableSet<InclusionDependency> maximumInds = ImmutableSet.of(
            new InclusionDependency(new ColumnPermutation(a1, a2, a3),
                    new ColumnPermutation(b1, b2, b3)));
    when(config.getInputGenerators())
            .thenReturn(ImmutableList.of(tableRGenerator, tableSGenerator));
    when(tableRGenerator.generateNewCopy()).then(in -> tableR.generateNewCopy());
    when(tableSGenerator.generateNewCopy()).then(in -> tableS.generateNewCopy());
    when(mockDao.getSortedRelationalInput(same(tableRGenerator), any(ColumnIdentifier.class),
            any(ColumnIdentifier.class), anyString(), anyBoolean()))
            .then(in -> tableR.generateNewCopy());
    when(mockDao.getSortedRelationalInput(same(tableSGenerator), any(ColumnIdentifier.class),
            any(ColumnIdentifier.class), anyString(), anyBoolean()))
            .then(in -> tableS.generateNewCopy());
    // WHEN
    mind2.execute(unaryInds);
    // THEN
    assertEqualMaxInds(resultReceiver.getReceivedResults(), maximumInds);
}