@Test
public void testCorrectness() {

    StringProperty s1 = new SimpleStringProperty("a");
    StringProperty s2 = new SimpleStringProperty("b");
    StringProperty s3 = new SimpleStringProperty("c");
    Val<String> firstNonNull = Val.orElse(s1, s2).orElse(s3);
    assertEquals("a", firstNonNull.getValue());
    s2.set(null);
    assertEquals("a", firstNonNull.getValue());
    s1.set(null);
    assertEquals("c", firstNonNull.getValue());
    s2.set("b");
    assertEquals("b", firstNonNull.getValue());
    s2.set(null);
    s3.set(null);
    assertNull(firstNonNull.getValue());
}