@Test
    void testRegexp() {
        RegExpItem empty = new RegExpItem("a", true, "");
        assertTrue(empty.isFromQuery());
        assertTrue(empty.isStemmed());
        assertEquals("a", empty.getIndexName());
        assertEquals("", empty.getIndexedString());
        assertEquals(1, empty.getNumWords());
        assertEquals(ItemType.REGEXP, empty.getItemType());

        assertEquals("a", new RegExpItem("i", true, "a").getIndexedString());
        assertEquals(".*", new RegExpItem("i", true, ".*").getIndexedString());
        PatternSyntaxException last = null;
        try {
            assertEquals(0, new RegExpItem("i", true, "*").getNumWords());
        } catch (PatternSyntaxException e) {
            last = e;
        }
        assertEquals("Dangling meta character '*' near index 0\n" + "*\n" + "^", last.getMessage());
    }
Check basic contracts common to "many" item implementations.

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