### Question:
ZIOResource implements AutoCloseable { public <R, B> ZIO<R, E, B> apply(Function1<? super A, ? extends ZIO<R, E, ? extends B>> use) { return resource.map(use.andThen(ZIOOf::<R, E, B>narrowK)).fold(ZIO::raiseError, identity()); } ZIOResource(Either<E, ? extends A> resource, Consumer1<? super A> release); ZIO<R, E, B> apply(Function1<? super A, ? extends ZIO<R, E, ? extends B>> use); @Override void close();  }### Answer:
@Test public void foldMapRight() { Async<Par_> async = ParInstances.async(); Kind<Par_, Integer> future = parseInt("0").foldMap(nothing(), async); assertEquals(0, future.fix(toPar()).apply(Future.DEFAULT_EXECUTOR).get()); }
@Test public void foldMapLeft() { Async<Par_> async = ParInstances.async(); Kind<Par_, Integer> future = parseInt("kjsdf").foldMap(nothing(), async); assertThrows(NumberFormatException.class, future.fix(toPar()).apply(Future.DEFAULT_EXECUTOR)::get); }