@Test
    void testDuplicateSource() {
        String chain1 = "chain1";
        String schema1 = "doc1", schema2 = "doc2";
        // Set up a single cluster and chain (chain1), containing a MockBackendSearcher and having 2 doc types (doc1, doc2)
        MockBackendSearcher mockBackendSearcher = new MockBackendSearcher();
        SearchChainRegistry searchChains = new SearchChainRegistry();
        searchChains.register(new Chain<>(chain1, mockBackendSearcher));
        SearchChainResolver resolver = new SearchChainResolver.Builder()
                .addSearchChain(new ComponentId(chain1), List.of(schema1, schema2))
                .build();
        var searcher = new FederationSearcher(resolver, Map.of(schema1, List.of(chain1), schema2, List.of(chain1)));

        Result result = searcher.search(new Query("?query=test&sources=doc1%2cdoc2"),
                new Execution(Execution.Context.createContextStub(searchChains)));

        assertNull(result.hits().getError());
        assertEquals(1, mockBackendSearcher.getInvocationCount());
    }
Tests that sources representing document types which resolve to the same actual source
are only included once.

@author bratseth
container-search/src/test/java/com/yahoo/search/federation/DuplicateSourceTestCase.java