Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.transformation.FilteredList;
public class FilteredListWithoutPredicate {
public static void main(String[] args) {
ObservableList<String> source = FXCollections.observableArrayList();
source.addAll("one", "two", "three");
System.out.println("source size: " + source.size());
System.out.println("without predicate: "
+ new FilteredList<>(source).size());
System.out.println("with predicate: "
+ new FilteredList<>(source, t -> true).size());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment