@Test public void testLaziness() { SimpleVar<String> s1 = (SimpleVar<String>) Var.newSimpleVar("a"); SimpleVar<String> s2 = (SimpleVar<String>) Var.newSimpleVar("b"); SimpleVar<String> s3 = (SimpleVar<String>) Var.newSimpleVar("c"); Val<String> firstNonNull = Val.orElse(s1, s2).orElse(s3); assertFalse(s1.isObservingInputs()); assertFalse(s2.isObservingInputs()); assertFalse(s2.isObservingInputs()); Subscription sub = firstNonNull.pin(); assertTrue(s1.isObservingInputs()); assertTrue(s2.isObservingInputs()); assertTrue(s2.isObservingInputs()); sub.unsubscribe(); assertFalse(s1.isObservingInputs()); assertFalse(s2.isObservingInputs()); assertFalse(s2.isObservingInputs()); }
OrElse( ObservableValue<? extends T> src, ObservableValue<? extends T> other) { this.src = src; this.other = other; }
OrElse extends ValBase<T> { OrElse( ObservableValue<? extends T> src, ObservableValue<? extends T> other) { this.src = src; this.other = other; } }
OrElse extends ValBase<T> { OrElse( ObservableValue<? extends T> src, ObservableValue<? extends T> other) { this.src = src; this.other = other; } OrElse(
            ObservableValue<? extends T> src,
            ObservableValue<? extends T> other); }
OrElse extends ValBase<T> { OrElse( ObservableValue<? extends T> src, ObservableValue<? extends T> other) { this.src = src; this.other = other; } OrElse(
            ObservableValue<? extends T> src,
            ObservableValue<? extends T> other);  }
OrElse extends ValBase<T> { OrElse( ObservableValue<? extends T> src, ObservableValue<? extends T> other) { this.src = src; this.other = other; } OrElse(
            ObservableValue<? extends T> src,
            ObservableValue<? extends T> other);   }