@Test
    void testRestrictLists2() {
        Query query = new Query();
        query.getModel().getSources().add("clusterTwo");
        query.getModel().getRestrict().add("three");
        IndexFacts indexFacts = createIndexFacts();
        IndexFacts.Session session = indexFacts.newSession(query);
        assertFalse(session.getIndex("c").isNull());
        assertTrue(session.getIndex("e").isNull());
        assertEquals("c", session.getCanonicName("C"));
        assertTrue(session.getIndex("c").isHostIndex());
        assertFalse(session.getIndex("a").isNull());
        assertFalse(session.getIndex("a").isHostIndex());
        assertEquals(StemMode.SHORTEST, session.getIndex("a").getStemMode());
        assertFalse(session.getIndex("b").isNull());
        assertFalse(session.getIndex("b").isUriIndex());
        assertFalse(session.getIndex("b").isHostIndex());
        assertEquals(StemMode.NONE, session.getIndex("b").getStemMode());
        assertEquals("NAME", session.getCanonicName("name"));
        assertEquals("NAME", session.getCanonicName("Name"));
        assertEquals("NAME", session.getCanonicName("NAME"));
        assertEquals("NAME", session.getCanonicName("nAmE"));
        query = new Query();
        session = indexFacts.newSession(query);
        assertEquals("name", session.getCanonicName("name"));
        assertEquals("NAME", session.getCanonicName("NAME"));
        // no way to choose among the valid names:
        assertEquals("nAmE", session.getCanonicName("nAmE"));
        query = new Query();
        query.getModel().getRestrict().add("one");
        query.getModel().getRestrict().add("two");
        session = indexFacts.newSession(query);
        assertEquals("name", session.getCanonicName("nAmE"));
        query = new Query();
        query.getModel().getRestrict().add("two");
        query.getModel().getRestrict().add("three");
        session = indexFacts.newSession(query);
        assertEquals("NAME", session.getCanonicName("nAmE"));
        query = new Query();
        query.getModel().getRestrict().add("one");
        query.getModel().getRestrict().add("three");
        session = indexFacts.newSession(query);
        assertEquals("nAmE", session.getCanonicName("nAmE"));
    }
Tests using synthetic index names for IndexFacts class.

@author Steinar Knutsen
container-search/src/test/java/com/yahoo/prelude/test/IndexFactsTestCase.java