@Test
public void filterByCode() throws Exception {

    showDialog();
    JListFixture list = windowFixture.list();
    final String code = getRandomCode().toLowerCase();
    windowFixture.textBox().enterText(code);
    windowFixture.robot.waitForIdle();
    // Note: there may be more than one list item if the code
    // we just typed is also the start of longer codes or if the 
    // code string happens to appear in descriptive text
    String[] items = list.contents();
    for (String item : items) {
        assertTrue(item.toLowerCase().contains(code));
    }
}