Property implements BiConsumer<Object, T>, Function<Object, Optional<T>> { @Override public void accept(final Object s, final T t) { setter.ifPresent(sOptionalBiConsumer -> sOptionalBiConsumer.accept(s, t)); } Property(
      @NotNull final Optional<Function<Object, T>> getter,
      @NotNull final Optional<BiConsumer<Object, T>> setter,
      @NotNull final boolean requiresDataContext); boolean requiresDataContext(); @Override void accept(final Object s, final T t); @Override Optional<T> apply(final Object s);  }
@Parameters({ "input", "anotherInput" }) @Test public void accept(String input) { final Property<String> target = new Property<>(Optional.of(c -> input), Optional.empty(), false); Assert.assertEquals(input, target.apply(new Object()).get()); Assert.assertEquals(input, target.apply("").get()); }