()
| 57 | } |
| 58 | |
| 59 | public static int testGenerics() throws ExecutionException, InterruptedException { |
| 60 | int output = CompletableFuture.supplyAsync(() -> 5) |
| 61 | .thenApply(i -> Integer.toString(i)) |
| 62 | .thenAccept(System.out::println) |
| 63 | .thenApply(v -> 7) |
| 64 | .get(); |
| 65 | |
| 66 | switch (output) { |
| 67 | case 7: |
| 68 | output = 10; |
| 69 | // fall through |
| 70 | default: |
| 71 | output = 7; |
| 72 | } |
| 73 | |
| 74 | return output; |
| 75 | } |
| 76 | |
| 77 | public abstract void annotationTest(@SimpleAnnotation("first") String first, |
| 78 | @SimpleAnnotation("second") String second); |