@Test
    void testPhraseSegmentBasics() {
        AndSegmentItem a = new AndSegmentItem("gnurk", "gurk", false, false);
        fill(a);
        a.lock();
        PhraseSegmentItem p = new PhraseSegmentItem(a);
        assertEquals("SPHRASE", p.getName());
        p.addItem(new WordItem("blbl"));
        boolean caught = false;
        try {
            p.addItem(new AndItem());
        } catch (IllegalArgumentException e) {
            caught = true;
        }
        assertTrue(caught);
        assertEquals("blbl", p.getWordItem(3).getWord());
        ByteBuffer b = ByteBuffer.allocate(5000);
        int i = p.encode(b);
        assertEquals(5, i);
        assertEquals("nalle bamse teddy blbl", p.getIndexedString());
    }
Check basic contracts common to "many" item implementations.

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