BooleanExpressions { public static ObservableBool any(ObservableValue<Boolean>... values) { return new AnyExpression(values); }  static ObservableBool any(ObservableValue<Boolean>... values); static ObservableBool not(@NotNull ObservableValue<Boolean> value); static final ObservableBool TRUE; static final ObservableBool FALSE; }
@Test public void testAnyExpression() throws Exception { BoolValueProperty srcValue1 = new BoolValueProperty(); BoolValueProperty srcValue2 = new BoolValueProperty(); BoolValueProperty srcValue3 = new BoolValueProperty(); BoolValueProperty destValue = new BoolValueProperty(); BindingsManager bindings = new BindingsManager(BindingsManager.INVOKE_IMMEDIATELY_STRATEGY); bindings.bind(destValue, BooleanExpressions.any(srcValue1, srcValue2, srcValue3)); assertThat(srcValue1.get()).isFalse(); assertThat(srcValue2.get()).isFalse(); assertThat(srcValue3.get()).isFalse(); assertThat(destValue.get()).isFalse(); srcValue1.set(true); srcValue2.set(false); srcValue3.set(false); assertThat(srcValue1.get()).isTrue(); assertThat(srcValue2.get()).isFalse(); assertThat(srcValue3.get()).isFalse(); assertThat(destValue.get()).isTrue(); srcValue1.set(false); srcValue2.set(true); srcValue3.set(false); assertThat(srcValue1.get()).isFalse(); assertThat(srcValue2.get()).isTrue(); assertThat(srcValue3.get()).isFalse(); assertThat(destValue.get()).isTrue(); srcValue1.set(true); srcValue2.set(false); srcValue3.set(true); assertThat(srcValue1.get()).isTrue(); assertThat(srcValue2.get()).isFalse(); assertThat(srcValue3.get()).isTrue(); assertThat(destValue.get()).isTrue(); srcValue1.set(true); srcValue2.set(true); srcValue3.set(true); assertThat(srcValue1.get()).isTrue(); assertThat(srcValue2.get()).isTrue(); assertThat(srcValue3.get()).isTrue(); assertThat(destValue.get()).isTrue(); srcValue1.set(false); srcValue2.set(false); srcValue3.set(false); assertThat(srcValue1.get()).isFalse(); assertThat(srcValue2.get()).isFalse(); assertThat(srcValue3.get()).isFalse(); assertThat(destValue.get()).isFalse(); }