Selection model's getSelectedItem() returns old data item after setting new item:
list = new ListView<Integer>();
ArrayList<Integer> data1 = new ArrayList<Integer>();
data1.add(new Integer(1));
list.setItems(FXCollections.observableList(data1));
list.getSelectionModel().select(0);
System.out.println(list.getSelectionModel().getSelectedItem());
ArrayList<Integer> data2 = new ArrayList<Integer>();
data2.add(new Integer(2));
list.setItems(FXCollections.observableList(data2));
System.out.println(list.getSelectionModel().getSelectedItem());
list = new ListView<Integer>();
ArrayList<Integer> data1 = new ArrayList<Integer>();
data1.add(new Integer(1));
list.setItems(FXCollections.observableList(data1));
list.getSelectionModel().select(0);
System.out.println(list.getSelectionModel().getSelectedItem());
ArrayList<Integer> data2 = new ArrayList<Integer>();
data2.add(new Integer(2));
list.setItems(FXCollections.observableList(data2));
System.out.println(list.getSelectionModel().getSelectedItem());