ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/CompletableFutureTest.java
(Generate patch)

Comparing jsr166/src/test/tck/CompletableFutureTest.java (file contents):
Revision 1.179 by jsr166, Thu Sep 22 22:05:49 2016 UTC vs.
Revision 1.185 by jsr166, Mon May 29 19:15:02 2017 UTC

# Line 64 | Line 64 | public class CompletableFutureTest exten
64              assertNull(f.getNow(null));
65          } catch (Throwable fail) { threadUnexpectedException(fail); }
66          try {
67 <            f.get(0L, SECONDS);
67 >            f.get(randomExpiredTimeout(), randomTimeUnit());
68              shouldThrow();
69          }
70          catch (TimeoutException success) {}
# Line 76 | Line 76 | public class CompletableFutureTest exten
76  
77          try {
78              assertEquals(value, f.join());
79        } catch (Throwable fail) { threadUnexpectedException(fail); }
80        try {
79              assertEquals(value, f.getNow(null));
82        } catch (Throwable fail) { threadUnexpectedException(fail); }
83        try {
80              assertEquals(value, f.get());
81          } catch (Throwable fail) { threadUnexpectedException(fail); }
82          assertTrue(f.isDone());
# Line 93 | Line 89 | public class CompletableFutureTest exten
89       * Returns the "raw" internal exceptional completion of f,
90       * without any additional wrapping with CompletionException.
91       */
92 <    <U> Throwable exceptionalCompletion(CompletableFuture<U> f) {
93 <        // handle (and whenComplete) can distinguish between "direct"
94 <        // and "wrapped" exceptional completion
95 <        return f.handle((U u, Throwable t) -> t).join();
92 >    Throwable exceptionalCompletion(CompletableFuture<?> f) {
93 >        // handle (and whenComplete and exceptionally) can distinguish
94 >        // between "direct" and "wrapped" exceptional completion
95 >        return f.handle((u, t) -> t).join();
96      }
97  
98      void checkCompletedExceptionally(CompletableFuture<?> f,
# Line 147 | Line 143 | public class CompletableFutureTest exten
143  
144      void checkCompletedWithWrappedCFException(CompletableFuture<?> f) {
145          checkCompletedExceptionally(f, true,
146 <            (t) -> assertTrue(t instanceof CFException));
146 >            t -> assertTrue(t instanceof CFException));
147      }
148  
149      void checkCompletedWithWrappedCancellationException(CompletableFuture<?> f) {
150          checkCompletedExceptionally(f, true,
151 <            (t) -> assertTrue(t instanceof CancellationException));
151 >            t -> assertTrue(t instanceof CancellationException));
152      }
153  
154      void checkCompletedWithTimeoutException(CompletableFuture<?> f) {
155          checkCompletedExceptionally(f, false,
156 <            (t) -> assertTrue(t instanceof TimeoutException));
156 >            t -> assertTrue(t instanceof TimeoutException));
157      }
158  
159      void checkCompletedWithWrappedException(CompletableFuture<?> f,
160                                              Throwable ex) {
161 <        checkCompletedExceptionally(f, true, (t) -> assertSame(t, ex));
161 >        checkCompletedExceptionally(f, true, t -> assertSame(t, ex));
162      }
163  
164      void checkCompletedExceptionally(CompletableFuture<?> f, Throwable ex) {
165 <        checkCompletedExceptionally(f, false, (t) -> assertSame(t, ex));
165 >        checkCompletedExceptionally(f, false, t -> assertSame(t, ex));
166      }
167  
168      void checkCancelled(CompletableFuture<?> f) {
# Line 2562 | Line 2558 | public class CompletableFutureTest exten
2558  
2559          // unspecified behavior - both source completions available
2560          try {
2561 <            assertEquals(null, h0.join());
2561 >            assertNull(h0.join());
2562              rs[0].assertValue(v1);
2563          } catch (CompletionException ok) {
2564              checkCompletedWithWrappedException(h0, ex);
2565              rs[0].assertNotInvoked();
2566          }
2567          try {
2568 <            assertEquals(null, h1.join());
2568 >            assertNull(h1.join());
2569              rs[1].assertValue(v1);
2570          } catch (CompletionException ok) {
2571              checkCompletedWithWrappedException(h1, ex);
2572              rs[1].assertNotInvoked();
2573          }
2574          try {
2575 <            assertEquals(null, h2.join());
2575 >            assertNull(h2.join());
2576              rs[2].assertValue(v1);
2577          } catch (CompletionException ok) {
2578              checkCompletedWithWrappedException(h2, ex);
2579              rs[2].assertNotInvoked();
2580          }
2581          try {
2582 <            assertEquals(null, h3.join());
2582 >            assertNull(h3.join());
2583              rs[3].assertValue(v1);
2584          } catch (CompletionException ok) {
2585              checkCompletedWithWrappedException(h3, ex);
# Line 2822 | Line 2818 | public class CompletableFutureTest exten
2818  
2819          // unspecified behavior - both source completions available
2820          try {
2821 <            assertEquals(null, h0.join());
2821 >            assertNull(h0.join());
2822              rs[0].assertInvoked();
2823          } catch (CompletionException ok) {
2824              checkCompletedWithWrappedException(h0, ex);
2825              rs[0].assertNotInvoked();
2826          }
2827          try {
2828 <            assertEquals(null, h1.join());
2828 >            assertNull(h1.join());
2829              rs[1].assertInvoked();
2830          } catch (CompletionException ok) {
2831              checkCompletedWithWrappedException(h1, ex);
2832              rs[1].assertNotInvoked();
2833          }
2834          try {
2835 <            assertEquals(null, h2.join());
2835 >            assertNull(h2.join());
2836              rs[2].assertInvoked();
2837          } catch (CompletionException ok) {
2838              checkCompletedWithWrappedException(h2, ex);
2839              rs[2].assertNotInvoked();
2840          }
2841          try {
2842 <            assertEquals(null, h3.join());
2842 >            assertNull(h3.join());
2843              rs[3].assertInvoked();
2844          } catch (CompletionException ok) {
2845              checkCompletedWithWrappedException(h3, ex);
# Line 3257 | Line 3253 | public class CompletableFutureTest exten
3253  
3254              () -> f.thenApply(null),
3255              () -> f.thenApplyAsync(null),
3256 <            () -> f.thenApplyAsync((x) -> x, null),
3256 >            () -> f.thenApplyAsync(x -> x, null),
3257              () -> f.thenApplyAsync(null, exec),
3258  
3259              () -> f.thenAccept(null),
3260              () -> f.thenAcceptAsync(null),
3261 <            () -> f.thenAcceptAsync((x) -> {} , null),
3261 >            () -> f.thenAcceptAsync(x -> {} , null),
3262              () -> f.thenAcceptAsync(null, exec),
3263  
3264              () -> f.thenRun(null),
# Line 3297 | Line 3293 | public class CompletableFutureTest exten
3293              () -> f.applyToEither(g, null),
3294              () -> f.applyToEitherAsync(g, null),
3295              () -> f.applyToEitherAsync(g, null, exec),
3296 <            () -> f.applyToEither(nullFuture, (x) -> x),
3297 <            () -> f.applyToEitherAsync(nullFuture, (x) -> x),
3298 <            () -> f.applyToEitherAsync(nullFuture, (x) -> x, exec),
3299 <            () -> f.applyToEitherAsync(g, (x) -> x, null),
3296 >            () -> f.applyToEither(nullFuture, x -> x),
3297 >            () -> f.applyToEitherAsync(nullFuture, x -> x),
3298 >            () -> f.applyToEitherAsync(nullFuture, x -> x, exec),
3299 >            () -> f.applyToEitherAsync(g, x -> x, null),
3300  
3301              () -> f.acceptEither(g, null),
3302              () -> f.acceptEitherAsync(g, null),
3303              () -> f.acceptEitherAsync(g, null, exec),
3304 <            () -> f.acceptEither(nullFuture, (x) -> {}),
3305 <            () -> f.acceptEitherAsync(nullFuture, (x) -> {}),
3306 <            () -> f.acceptEitherAsync(nullFuture, (x) -> {}, exec),
3307 <            () -> f.acceptEitherAsync(g, (x) -> {}, null),
3304 >            () -> f.acceptEither(nullFuture, x -> {}),
3305 >            () -> f.acceptEitherAsync(nullFuture, x -> {}),
3306 >            () -> f.acceptEitherAsync(nullFuture, x -> {}, exec),
3307 >            () -> f.acceptEitherAsync(g, x -> {}, null),
3308  
3309              () -> f.runAfterEither(g, null),
3310              () -> f.runAfterEitherAsync(g, null),
# Line 3374 | Line 3370 | public class CompletableFutureTest exten
3370          for (CompletableFuture<Integer> src : srcs) {
3371              List<CompletableFuture<?>> fs = new ArrayList<>();
3372              fs.add(src.thenRunAsync(() -> {}, e));
3373 <            fs.add(src.thenAcceptAsync((z) -> {}, e));
3374 <            fs.add(src.thenApplyAsync((z) -> z, e));
3373 >            fs.add(src.thenAcceptAsync(z -> {}, e));
3374 >            fs.add(src.thenApplyAsync(z -> z, e));
3375  
3376              fs.add(src.thenCombineAsync(src, (x, y) -> x, e));
3377              fs.add(src.thenAcceptBothAsync(src, (x, y) -> {}, e));
3378              fs.add(src.runAfterBothAsync(src, () -> {}, e));
3379  
3380 <            fs.add(src.applyToEitherAsync(src, (z) -> z, e));
3381 <            fs.add(src.acceptEitherAsync(src, (z) -> {}, e));
3380 >            fs.add(src.applyToEitherAsync(src, z -> z, e));
3381 >            fs.add(src.acceptEitherAsync(src, z -> {}, e));
3382              fs.add(src.runAfterEitherAsync(src, () -> {}, e));
3383  
3384 <            fs.add(src.thenComposeAsync((z) -> null, e));
3384 >            fs.add(src.thenComposeAsync(z -> null, e));
3385              fs.add(src.whenCompleteAsync((z, t) -> {}, e));
3386              fs.add(src.handleAsync((z, t) -> null, e));
3387  
# Line 3418 | Line 3414 | public class CompletableFutureTest exten
3414          {
3415              List<CompletableFuture<?>> fs = new ArrayList<>();
3416  
3417 <            fs.add(complete.applyToEitherAsync(incomplete, (z) -> z, e));
3418 <            fs.add(incomplete.applyToEitherAsync(complete, (z) -> z, e));
3417 >            fs.add(complete.applyToEitherAsync(incomplete, z -> z, e));
3418 >            fs.add(incomplete.applyToEitherAsync(complete, z -> z, e));
3419  
3420 <            fs.add(complete.acceptEitherAsync(incomplete, (z) -> {}, e));
3421 <            fs.add(incomplete.acceptEitherAsync(complete, (z) -> {}, e));
3420 >            fs.add(complete.acceptEitherAsync(incomplete, z -> {}, e));
3421 >            fs.add(incomplete.acceptEitherAsync(complete, z -> {}, e));
3422  
3423              fs.add(complete.runAfterEitherAsync(incomplete, () -> {}, e));
3424              fs.add(incomplete.runAfterEitherAsync(complete, () -> {}, e));
# Line 3461 | Line 3457 | public class CompletableFutureTest exten
3457  
3458          List<CompletableFuture<?>> fs = new ArrayList<>();
3459          fs.add(incomplete.thenRunAsync(() -> {}, e));
3460 <        fs.add(incomplete.thenAcceptAsync((z) -> {}, e));
3461 <        fs.add(incomplete.thenApplyAsync((z) -> z, e));
3460 >        fs.add(incomplete.thenAcceptAsync(z -> {}, e));
3461 >        fs.add(incomplete.thenApplyAsync(z -> z, e));
3462  
3463          fs.add(incomplete.thenCombineAsync(incomplete, (x, y) -> x, e));
3464          fs.add(incomplete.thenAcceptBothAsync(incomplete, (x, y) -> {}, e));
3465          fs.add(incomplete.runAfterBothAsync(incomplete, () -> {}, e));
3466  
3467 <        fs.add(incomplete.applyToEitherAsync(incomplete, (z) -> z, e));
3468 <        fs.add(incomplete.acceptEitherAsync(incomplete, (z) -> {}, e));
3467 >        fs.add(incomplete.applyToEitherAsync(incomplete, z -> z, e));
3468 >        fs.add(incomplete.acceptEitherAsync(incomplete, z -> {}, e));
3469          fs.add(incomplete.runAfterEitherAsync(incomplete, () -> {}, e));
3470  
3471 <        fs.add(incomplete.thenComposeAsync((z) -> null, e));
3471 >        fs.add(incomplete.thenComposeAsync(z -> null, e));
3472          fs.add(incomplete.whenCompleteAsync((z, t) -> {}, e));
3473          fs.add(incomplete.handleAsync((z, t) -> null, e));
3474  
# Line 3532 | Line 3528 | public class CompletableFutureTest exten
3528       */
3529      public void testCompletedStage() {
3530          AtomicInteger x = new AtomicInteger(0);
3531 <        AtomicReference<Throwable> r = new AtomicReference<Throwable>();
3531 >        AtomicReference<Throwable> r = new AtomicReference<>();
3532          CompletionStage<Integer> f = CompletableFuture.completedStage(1);
3533          f.whenComplete((v, e) -> {if (e != null) r.set(e); else x.set(v);});
3534          assertEquals(x.get(), 1);
# Line 3634 | Line 3630 | public class CompletableFutureTest exten
3630          CompletableFuture<Integer> f = new CompletableFuture<>();
3631          CompletionStage<Integer> g = f.minimalCompletionStage();
3632          AtomicInteger x = new AtomicInteger(0);
3633 <        AtomicReference<Throwable> r = new AtomicReference<Throwable>();
3633 >        AtomicReference<Throwable> r = new AtomicReference<>();
3634          checkIncomplete(f);
3635          g.whenComplete((v, e) -> {if (e != null) r.set(e); else x.set(v);});
3636          f.complete(1);
# Line 3651 | Line 3647 | public class CompletableFutureTest exten
3647          CompletableFuture<Integer> f = new CompletableFuture<>();
3648          CompletionStage<Integer> g = f.minimalCompletionStage();
3649          AtomicInteger x = new AtomicInteger(0);
3650 <        AtomicReference<Throwable> r = new AtomicReference<Throwable>();
3650 >        AtomicReference<Throwable> r = new AtomicReference<>();
3651          g.whenComplete((v, e) -> {if (e != null) r.set(e); else x.set(v);});
3652          checkIncomplete(f);
3653          CFException ex = new CFException();
# Line 3669 | Line 3665 | public class CompletableFutureTest exten
3665          CFException ex = new CFException();
3666          CompletionStage<Integer> f = CompletableFuture.failedStage(ex);
3667          AtomicInteger x = new AtomicInteger(0);
3668 <        AtomicReference<Throwable> r = new AtomicReference<Throwable>();
3668 >        AtomicReference<Throwable> r = new AtomicReference<>();
3669          f.whenComplete((v, e) -> {if (e != null) r.set(e); else x.set(v);});
3670          assertEquals(x.get(), 0);
3671          assertEquals(r.get(), ex);
# Line 3693 | Line 3689 | public class CompletableFutureTest exten
3689      public void testCompleteAsync2() {
3690          CompletableFuture<Integer> f = new CompletableFuture<>();
3691          CFException ex = new CFException();
3692 <        f.completeAsync(() -> {if (true) throw ex; return 1;});
3692 >        f.completeAsync(() -> { throw ex; });
3693          try {
3694              f.join();
3695              shouldThrow();
# Line 3723 | Line 3719 | public class CompletableFutureTest exten
3719          CompletableFuture<Integer> f = new CompletableFuture<>();
3720          CFException ex = new CFException();
3721          ThreadExecutor executor = new ThreadExecutor();
3722 <        f.completeAsync(() -> {if (true) throw ex; return 1;}, executor);
3722 >        f.completeAsync(() -> { throw ex; }, executor);
3723          try {
3724              f.join();
3725              shouldThrow();
# Line 3882 | Line 3878 | public class CompletableFutureTest exten
3878          List<Function<CompletableFuture<Integer>, CompletableFuture<?>>> funs
3879              = new ArrayList<>();
3880  
3881 <        funs.add((y) -> m.thenRun(y, noopRunnable));
3882 <        funs.add((y) -> m.thenAccept(y, noopConsumer));
3883 <        funs.add((y) -> m.thenApply(y, incFunction));
3884 <
3885 <        funs.add((y) -> m.runAfterEither(y, incomplete, noopRunnable));
3886 <        funs.add((y) -> m.acceptEither(y, incomplete, noopConsumer));
3887 <        funs.add((y) -> m.applyToEither(y, incomplete, incFunction));
3888 <
3889 <        funs.add((y) -> m.runAfterBoth(y, v42, noopRunnable));
3890 <        funs.add((y) -> m.runAfterBoth(v42, y, noopRunnable));
3891 <        funs.add((y) -> m.thenAcceptBoth(y, v42, new SubtractAction(m)));
3892 <        funs.add((y) -> m.thenAcceptBoth(v42, y, new SubtractAction(m)));
3893 <        funs.add((y) -> m.thenCombine(y, v42, new SubtractFunction(m)));
3894 <        funs.add((y) -> m.thenCombine(v42, y, new SubtractFunction(m)));
3895 <
3896 <        funs.add((y) -> m.whenComplete(y, (Integer r, Throwable t) -> {}));
3897 <
3898 <        funs.add((y) -> m.thenCompose(y, new CompletableFutureInc(m)));
3899 <
3900 <        funs.add((y) -> CompletableFuture.allOf(y));
3901 <        funs.add((y) -> CompletableFuture.allOf(y, v42));
3902 <        funs.add((y) -> CompletableFuture.allOf(v42, y));
3903 <        funs.add((y) -> CompletableFuture.anyOf(y));
3904 <        funs.add((y) -> CompletableFuture.anyOf(y, incomplete));
3905 <        funs.add((y) -> CompletableFuture.anyOf(incomplete, y));
3881 >        funs.add(y -> m.thenRun(y, noopRunnable));
3882 >        funs.add(y -> m.thenAccept(y, noopConsumer));
3883 >        funs.add(y -> m.thenApply(y, incFunction));
3884 >
3885 >        funs.add(y -> m.runAfterEither(y, incomplete, noopRunnable));
3886 >        funs.add(y -> m.acceptEither(y, incomplete, noopConsumer));
3887 >        funs.add(y -> m.applyToEither(y, incomplete, incFunction));
3888 >
3889 >        funs.add(y -> m.runAfterBoth(y, v42, noopRunnable));
3890 >        funs.add(y -> m.runAfterBoth(v42, y, noopRunnable));
3891 >        funs.add(y -> m.thenAcceptBoth(y, v42, new SubtractAction(m)));
3892 >        funs.add(y -> m.thenAcceptBoth(v42, y, new SubtractAction(m)));
3893 >        funs.add(y -> m.thenCombine(y, v42, new SubtractFunction(m)));
3894 >        funs.add(y -> m.thenCombine(v42, y, new SubtractFunction(m)));
3895 >
3896 >        funs.add(y -> m.whenComplete(y, (Integer r, Throwable t) -> {}));
3897 >
3898 >        funs.add(y -> m.thenCompose(y, new CompletableFutureInc(m)));
3899 >
3900 >        funs.add(y -> CompletableFuture.allOf(y));
3901 >        funs.add(y -> CompletableFuture.allOf(y, v42));
3902 >        funs.add(y -> CompletableFuture.allOf(v42, y));
3903 >        funs.add(y -> CompletableFuture.anyOf(y));
3904 >        funs.add(y -> CompletableFuture.anyOf(y, incomplete));
3905 >        funs.add(y -> CompletableFuture.anyOf(incomplete, y));
3906  
3907          for (Function<CompletableFuture<Integer>, CompletableFuture<?>>
3908                   fun : funs) {
# Line 3963 | Line 3959 | public class CompletableFutureTest exten
3959      public void testMinimalCompletionStage_minimality() {
3960          if (!testImplementationDetails) return;
3961          Function<Method, String> toSignature =
3962 <            (method) -> method.getName() + Arrays.toString(method.getParameterTypes());
3962 >            method -> method.getName() + Arrays.toString(method.getParameterTypes());
3963          Predicate<Method> isNotStatic =
3964 <            (method) -> (method.getModifiers() & Modifier.STATIC) == 0;
3964 >            method -> (method.getModifiers() & Modifier.STATIC) == 0;
3965          List<Method> minimalMethods =
3966              Stream.of(Object.class, CompletionStage.class)
3967 <            .flatMap((klazz) -> Stream.of(klazz.getMethods()))
3967 >            .flatMap(klazz -> Stream.of(klazz.getMethods()))
3968              .filter(isNotStatic)
3969              .collect(Collectors.toList());
3970          // Methods from CompletableFuture permitted NOT to throw UOE
# Line 3984 | Line 3980 | public class CompletableFutureTest exten
3980              .collect(Collectors.toSet());
3981          List<Method> allMethods = Stream.of(CompletableFuture.class.getMethods())
3982              .filter(isNotStatic)
3983 <            .filter((method) -> !permittedMethodSignatures.contains(toSignature.apply(method)))
3983 >            .filter(method -> !permittedMethodSignatures.contains(toSignature.apply(method)))
3984              .collect(Collectors.toList());
3985  
3986          List<CompletionStage<Integer>> stages = new ArrayList<>();
# Line 4144 | Line 4140 | public class CompletableFutureTest exten
4140          CompletionStage<Integer> minimal = f.minimalCompletionStage();
4141          CompletableFuture<Integer> g = new CompletableFuture<>();
4142          if (!createIncomplete) assertTrue(f.complete(v1));
4143 <        minimal.thenAccept((x) -> g.complete(x));
4143 >        minimal.thenAccept(x -> g.complete(x));
4144          if (createIncomplete) assertTrue(f.complete(v1));
4145          g.join();
4146          checkCompletedNormally(g, v1);
# Line 4168 | Line 4164 | public class CompletableFutureTest exten
4164          static <T,U,V> Function<T, CompletableFuture<V>> compose
4165              (Function<T, CompletableFuture<U>> f,
4166               Function<U, CompletableFuture<V>> g) {
4167 <            return (x) -> f.apply(x).thenCompose(g);
4167 >            return x -> f.apply(x).thenCompose(g);
4168          }
4169  
4170          static void assertZero(CompletableFuture<?> f) {
# Line 4248 | Line 4244 | public class CompletableFutureTest exten
4244  
4245          // Some mutually non-commutative functions
4246          Function<Long, CompletableFuture<Long>> triple
4247 <            = (x) -> Monad.unit(3 * x);
4247 >            = x -> Monad.unit(3 * x);
4248          Function<Long, CompletableFuture<Long>> inc
4249 <            = (x) -> Monad.unit(x + 1);
4249 >            = x -> Monad.unit(x + 1);
4250  
4251          // unit is a right identity: m >>= unit === m
4252          Monad.assertFutureEquals(inc.apply(5L).thenCompose(unit),
# Line 4262 | Line 4258 | public class CompletableFutureTest exten
4258          // associativity: (m >>= f) >>= g === m >>= ( \x -> (f x >>= g) )
4259          Monad.assertFutureEquals(
4260              unit.apply(5L).thenCompose(inc).thenCompose(triple),
4261 <            unit.apply(5L).thenCompose((x) -> inc.apply(x).thenCompose(triple)));
4261 >            unit.apply(5L).thenCompose(x -> inc.apply(x).thenCompose(triple)));
4262  
4263          // The case for CompletableFuture as an additive monad is weaker...
4264  
# Line 4272 | Line 4268 | public class CompletableFutureTest exten
4268          // left zero: zero >>= f === zero
4269          Monad.assertZero(zero.thenCompose(inc));
4270          // right zero: f >>= (\x -> zero) === zero
4271 <        Monad.assertZero(inc.apply(5L).thenCompose((x) -> zero));
4271 >        Monad.assertZero(inc.apply(5L).thenCompose(x -> zero));
4272  
4273          // f plus zero === f
4274          Monad.assertFutureEquals(Monad.unit(5L),
# Line 4330 | Line 4326 | public class CompletableFutureTest exten
4326          final AtomicInteger count = new AtomicInteger(0);
4327          for (int i = 0; i < n; i++) {
4328              head.thenRun(() -> count.getAndIncrement());
4329 <            head.thenAccept((x) -> count.getAndIncrement());
4330 <            head.thenApply((x) -> count.getAndIncrement());
4329 >            head.thenAccept(x -> count.getAndIncrement());
4330 >            head.thenApply(x -> count.getAndIncrement());
4331  
4332              head.runAfterBoth(complete, () -> count.getAndIncrement());
4333              head.thenAcceptBoth(complete, (x, y) -> count.getAndIncrement());
# Line 4341 | Line 4337 | public class CompletableFutureTest exten
4337              complete.thenCombine(head, (x, y) -> count.getAndIncrement());
4338  
4339              head.runAfterEither(new CompletableFuture<Void>(), () -> count.getAndIncrement());
4340 <            head.acceptEither(new CompletableFuture<Void>(), (x) -> count.getAndIncrement());
4341 <            head.applyToEither(new CompletableFuture<Void>(), (x) -> count.getAndIncrement());
4340 >            head.acceptEither(new CompletableFuture<Void>(), x -> count.getAndIncrement());
4341 >            head.applyToEither(new CompletableFuture<Void>(), x -> count.getAndIncrement());
4342              new CompletableFuture<Void>().runAfterEither(head, () -> count.getAndIncrement());
4343 <            new CompletableFuture<Void>().acceptEither(head, (x) -> count.getAndIncrement());
4344 <            new CompletableFuture<Void>().applyToEither(head, (x) -> count.getAndIncrement());
4343 >            new CompletableFuture<Void>().acceptEither(head, x -> count.getAndIncrement());
4344 >            new CompletableFuture<Void>().applyToEither(head, x -> count.getAndIncrement());
4345          }
4346          head.complete(null);
4347          assertEquals(5 * 3 * n, count.get());
# Line 4362 | Line 4358 | public class CompletableFutureTest exten
4358              f.complete(null);
4359  
4360              f = new CompletableFuture<>();
4361 <            f.acceptEither(incomplete, (x) -> {});
4361 >            f.acceptEither(incomplete, x -> {});
4362              f.complete(null);
4363  
4364              f = new CompletableFuture<>();
4365 <            f.applyToEither(incomplete, (x) -> x);
4365 >            f.applyToEither(incomplete, x -> x);
4366              f.complete(null);
4367  
4368              f = new CompletableFuture<>();
# Line 4380 | Line 4376 | public class CompletableFutureTest exten
4376              f.complete(null);
4377  
4378              f = new CompletableFuture<>();
4379 <            incomplete.acceptEither(f, (x) -> {});
4379 >            incomplete.acceptEither(f, x -> {});
4380              f.complete(null);
4381  
4382              f = new CompletableFuture<>();
4383 <            incomplete.applyToEither(f, (x) -> x);
4383 >            incomplete.applyToEither(f, x -> x);
4384              f.complete(null);
4385  
4386              f = new CompletableFuture<>();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines