### Question:
ObservableRules { public static ObservableBooleanValue notEmpty(ObservableValue<String> source) { return Bindings.createBooleanBinding(() -> { final String s = source.getValue(); return s != null && !s.trim().isEmpty(); }, source); }  static ObservableBooleanValue fromPredicate(ObservableValue<T> source, Predicate<T> predicate); static ObservableBooleanValue notEmpty(ObservableValue<String> source); static ObservableBooleanValue matches(ObservableValue<String> source, Pattern pattern);  }### Answer:
@Test public void testNotNullOrEmpty() { StringProperty value = new SimpleStringProperty(); final ObservableBooleanValue rule = ObservableRules.notEmpty(value); assertThat(rule.get()).isFalse(); value.set("test"); assertThat(rule.get()).isTrue(); value.set(""); assertThat(rule.get()).isFalse(); value.set(" dds "); assertThat(rule.get()).isTrue(); value.set(" "); assertThat(rule.get()).isFalse(); value.set("1"); assertThat(rule.get()).isTrue(); value.set(null); assertThat(rule.get()).isFalse(); }