  @Test
  public void tasksRunInProcesses() throws Exception {


    final Instant today = Instant.now().truncatedTo(ChronoUnit.DAYS);
    final Instant yesterday = today.minus(1, ChronoUnit.DAYS);

    final Task<String> baz = Task.named("baz", today).ofType(String.class)
        .process(() -> {
          final String bazJvm = jvmName();
          log.info("baz: bazJvm={}, today={}", bazJvm, today);
          return bazJvm;
        });

    final Task<String[]> foo = Task.named("foo", yesterday).ofType(String[].class)
        .input(() -> baz)
        .process(bazJvm -> {
          final String fooJvm = jvmName();
          log.info("foo: fooJvm={}, bazJvm={}, yesterday={}", fooJvm, bazJvm, yesterday);
          return new String[]{bazJvm, fooJvm};
        });

    final Task<String> quux = Task.named("quux", today).ofType(String.class)
        .process(() -> {
          final String quuxJvm = jvmName();
          log.info("quux: quuxJvm={}, yesterday={}", quuxJvm, yesterday);
          return quuxJvm;
        });

    final Task<String[]> bar = Task.named("bar", today, yesterday).ofType(String[].class)
        .input(() -> foo)
        .input(() -> quux)
        .process((bazFooJvms, quuxJvm) -> {
          final String barJvm = jvmName();
          log.info("bar: barJvm={}, bazFooJvms={}, quuxJvm={} today={}, yesterday={}",
              barJvm, bazFooJvms, quuxJvm, today, yesterday);
          return Stream.concat(
              Stream.of(barJvm),
              Stream.concat(
                  Stream.of(bazFooJvms),
                  Stream.of(quuxJvm))
          ).toArray(String[]::new);
        });

    final List<String> jvms = Arrays.asList(runTask(bar).value());

    final String mainJvm = jvmName();

    log.info("main jvm: {}", mainJvm);
    log.info("task jvms: {}", jvms);
    final Set<String> uniqueJvms = new HashSet<>(jvms);
    assertThat(uniqueJvms.size(), is(4));
    assertThat(uniqueJvms, not(contains(mainJvm)));
  }