@Test
    void testAndSegmenting() {
        Item root = tester.parseQuery("a'b&c'd", Language.ENGLISH, Query.Type.ALL);
        assertTrue(root instanceof AndItem);
        AndItem top = (AndItem) root;
        assertTrue(top.getItem(0) instanceof AndSegmentItem);
        assertTrue(top.getItem(1) instanceof AndSegmentItem);
        AndSegmentItem seg1 = (AndSegmentItem) top.getItem(0);
        AndSegmentItem seg2 = (AndSegmentItem) top.getItem(1);
        Item t1 = seg1.getItem(0);
        Item t2 = seg1.getItem(1);
        Item t3 = seg2.getItem(0);
        Item t4 = seg2.getItem(1);
        assertTrue(((TaggableItem) t2).hasUniqueID());
        assertTrue(((TaggableItem) t3).hasUniqueID());
        assertEquals(((TaggableItem) t1).getConnectedItem(), t2);
        assertEquals(((TaggableItem) t2).getConnectedItem(), t3);
        assertEquals(((TaggableItem) t3).getConnectedItem(), t4);
    }
Shortcut terms are represented as any other terms, but can be rewritten downstream.
The information about added bangs is available from the origin as shown (do not use the weight to find this)
container-search/src/test/java/com/yahoo/prelude/query/parser/test/ParseTestCase.java