@Test
public void filterByNameFragment() throws Exception {

    showDialog();
    JListFixture list = windowFixture.list();
    final int FILTER_STRING_LEN = 5;
    String filterStr = null;
    while (filterStr == null) {
        String code = getRandomCode();
        String desc = FACTORY.getDescriptionText(
                JCRSChooser.DEFAULT_AUTHORITY + ":" + code).toString();
        // double check the text is suitable for filtering
        if (desc != null && desc.length() >= FILTER_STRING_LEN) {
            filterStr = desc.substring(0, FILTER_STRING_LEN).toLowerCase();
        }
    }
    // Filter on the first few characters
    windowFixture.textBox().enterText(filterStr);
    windowFixture.robot.waitForIdle();
    // Check list contents
    for (String item : list.contents()) {
        assertTrue(item.toLowerCase().contains(filterStr));
    }
}