@Test
public void testGetSelectedValue() {

    DefaultListModel model = new DefaultListModel();
    model.addElement("One");
    model.addElement("Two");
    model.addElement("Three");
    model.addElement("Four");
    model.addElement("Five");
    model.addElement("Six");
    model.addElement("Seven");
    JXList list = new JXList();
    list.setAutoCreateRowSorter(true);
    list.setModel(model);
    list.setSelectedIndex(2);
    assertEquals("Three", list.getSelectedValue());
    list.setRowFilter(new RowFilter<ListModel, Integer>() {
        @Override
        public boolean include(Entry<? extends ListModel, ? extends Integer> entry) {
            return entry.getStringValue(entry.getIdentifier()).contains("e");
        }
    });
    assertEquals("Three", list.getSelectedValue());
}