@Test @Disabled("I don't understand very well this") public void compose(@Mock Consumer1<String> console) { Schedule<Nothing, Unit, Integer> two = Schedule.<Nothing, Unit>recurs(1).compose(Schedule.<Nothing, Integer>recurs(1)); ZIO<Nothing, Throwable, Unit> print = ZIO.exec(() -> console.accept("hola")); ZIO<Nothing, Throwable, Integer> repeat = print.repeat(two); Either<Throwable, Integer> provide = repeat.provide(nothing()); assertEquals(Either.right(1), provide); verify(console, times(3)).accept("hola"); }
@SuppressWarnings("unchecked") @Override public <C> Schedule<R, A, C> compose(Schedule<R, B, C> other) { return _compose((ScheduleImpl<R, ?, B, C>) other); }
ScheduleImpl implements SealedSchedule<R, A, B>, Schedule.Update<R, S, A>, Schedule.Extract<A, S, B> { @SuppressWarnings("unchecked") @Override public <C> Schedule<R, A, C> compose(Schedule<R, B, C> other) { return _compose((ScheduleImpl<R, ?, B, C>) other); } }
ScheduleImpl implements SealedSchedule<R, A, B>, Schedule.Update<R, S, A>, Schedule.Extract<A, S, B> { @SuppressWarnings("unchecked") @Override public <C> Schedule<R, A, C> compose(Schedule<R, B, C> other) { return _compose((ScheduleImpl<R, ?, B, C>) other); } private  ScheduleImpl(); }
ScheduleImpl implements SealedSchedule<R, A, B>, Schedule.Update<R, S, A>, Schedule.Extract<A, S, B> { @SuppressWarnings("unchecked") @Override public <C> Schedule<R, A, C> compose(Schedule<R, B, C> other) { return _compose((ScheduleImpl<R, ?, B, C>) other); } private  ScheduleImpl(); abstract URIO<R, S> initial(); @Override Schedule<R, A, C> map(Function1<? super B, ? extends C> mapper); @Override Schedule<R, C, B> contramap(Function1<? super C, ? extends A> comap); Schedule<R, A, B> andThen(Schedule<R, A, B> next); @SuppressWarnings("unchecked") Schedule<R, A, Either<B, C>> andThenEither(Schedule<R, A, C> next); @SuppressWarnings("unchecked") @Override Schedule<R, A, Tuple2<B, C>> zip(Schedule<R, A, C> other); @SuppressWarnings("unchecked") @Override Schedule<R, A, C> compose(Schedule<R, B, C> other); @Override Schedule<R, A, Z> foldM(Z zero, Function2<Z, B, ZIO<R, Unit, Z>> next); @Override Schedule<R, A, B> addDelayM(Function1<B, URIO<R, Duration>> map); @Override Schedule<R, A, B> untilInputM(Function1<A, UIO<Boolean>> condition); @Override Schedule<R, A, B> untilOutputM(Function1<B, UIO<Boolean>> condition); @Override Schedule<R, A, B> check(Function2<A, B, UIO<Boolean>> condition); static ScheduleImpl<R, S, A, B> of(
      URIO<R, S> initial, 
      Update<R, S, A> update,
      Extract<A, S, B> extract); }
ScheduleImpl implements SealedSchedule<R, A, B>, Schedule.Update<R, S, A>, Schedule.Extract<A, S, B> { @SuppressWarnings("unchecked") @Override public <C> Schedule<R, A, C> compose(Schedule<R, B, C> other) { return _compose((ScheduleImpl<R, ?, B, C>) other); } private  ScheduleImpl(); abstract URIO<R, S> initial(); @Override Schedule<R, A, C> map(Function1<? super B, ? extends C> mapper); @Override Schedule<R, C, B> contramap(Function1<? super C, ? extends A> comap); Schedule<R, A, B> andThen(Schedule<R, A, B> next); @SuppressWarnings("unchecked") Schedule<R, A, Either<B, C>> andThenEither(Schedule<R, A, C> next); @SuppressWarnings("unchecked") @Override Schedule<R, A, Tuple2<B, C>> zip(Schedule<R, A, C> other); @SuppressWarnings("unchecked") @Override Schedule<R, A, C> compose(Schedule<R, B, C> other); @Override Schedule<R, A, Z> foldM(Z zero, Function2<Z, B, ZIO<R, Unit, Z>> next); @Override Schedule<R, A, B> addDelayM(Function1<B, URIO<R, Duration>> map); @Override Schedule<R, A, B> untilInputM(Function1<A, UIO<Boolean>> condition); @Override Schedule<R, A, B> untilOutputM(Function1<B, UIO<Boolean>> condition); @Override Schedule<R, A, B> check(Function2<A, B, UIO<Boolean>> condition); static ScheduleImpl<R, S, A, B> of(
      URIO<R, S> initial, 
      Update<R, S, A> update,
      Extract<A, S, B> extract);  }