public <R> Choice<R> thenOption(Function<? super T, Optional<R>> function) {
    checkNotNull(function);
    Choice<T> thisChoice = this;
    return new Choice<R>() {
      @Override
      protected Iterator<R> iterator() {
        return Optional.presentInstances(Iterables.transform(thisChoice.asIterable(), function))
            .iterator();
      }
    };
  }
@Test
  public void thenOption() {
    assertThat(
            Choice.from(ImmutableList.of(1, 2, 3))
                .thenOption(
                    Functions.forMap(
                        ImmutableMap.of(2, Optional.of("foo")), Optional.<String>absent()))
                .asIterable())
        .containsExactly("foo");
  }