MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / test

Method test

lowlevel/SyncOnObject.java:32–41  ·  view source on GitHub ↗
(boolean fNap, boolean gNap)

Source from the content-addressed store, hash-verified

30
31public class SyncOnObject {
32 static void test(boolean fNap, boolean gNap) {
33 DualSynch ds = new DualSynch();
34 List<CompletableFuture<Void>> cfs =
35 Arrays.stream(new Runnable[] {
36 () -> ds.f(fNap), () -> ds.g(gNap) })
37 .map(CompletableFuture::runAsync)
38 .collect(Collectors.toList());
39 cfs.forEach(CompletableFuture::join);
40 ds.trace.forEach(System.out::println);
41 }
42 public static void main(String[] args) {
43 test(true, false);
44 System.out.println("****");

Callers 1

mainMethod · 0.95

Calls 3

fMethod · 0.95
gMethod · 0.95
streamMethod · 0.45

Tested by

no test coverage detected