void (Consumer<? super T> callback) { myBuilder.setItemChosenCallback(() -> { T selectedValue = myList.getSelectedValue(); if (selectedValue != null || !myList.isSelectionEmpty()) { callback.consume(selectedValue); } }); }