public <R> Choice<R> thenChoose(Function<? super T, Choice<R>> function) {
    checkNotNull(function);
    if (Thread.interrupted()) {
      throw new RuntimeException(new InterruptedException());
    }
    Choice<T> thisChoice = this;
    return new Choice<R>() {
      @Override
      protected Iterator<R> iterator() {
        if (Thread.interrupted()) {
          throw new RuntimeException(new InterruptedException());
        }
        return Iterators.concat(
            Iterators.transform(thisChoice.iterator(), (T t) -> function.apply(t).iterator()));
      }
    };
  }
@Test
  public void thenChoose() {
    assertThat(
            Choice.from(ImmutableList.of(1, 2, 3))
                .thenChoose(
                    Functions.forMap(ImmutableMap.of(2, Choice.of("foo")), Choice.<String>none()))
                .asIterable())
        .containsExactly("foo");
  }