import javafx.application.Application;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.value.ObservableValue;
import javafx.stage.Stage;

public class Test extends Application {

	public static void main(String[] args) {
		launch(args);

	}

	@Override
	public void start(Stage primaryStage) throws Exception {
		ObservableValue<@Nullable String> input = new SimpleObjectProperty<>(null);
		ObservableValue<@NotNull Integer> output = input.map(text -> {
			if (text == null) {
				return 0;
			} else {
				return text.length();
			}
		});
		assertEquals(0, output.getValue());

	}
}
