File tree 1 file changed +27
-0
lines changed 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
[ ![ Build Status] ( https://travis-ci.com/sageserpent-open/americium.svg?branch=master )] ( https://travis-ci.com/sageserpent-open/americium )
4
4
[ ![ Maven Central] ( https://index.scala-lang.org/sageserpent-open/americium/americium/latest-by-scala-version.svg?color=2465cd&style=flat )] ( https://index.scala-lang.org/sageserpent-open/americium/americium )
5
+ ``` java
6
+ // JShell...
7
+
8
+ import com.sageserpent.americium.java.Trials ;
9
+ import com.sageserpent.americium.java.TrialsApi ;
10
+ import com.sageserpent.americium.java.TrialsFactoring ;
11
+
12
+ import java.util.Collection ;
13
+
14
+ final TrialsApi api = Trials . api();
15
+
16
+ class SystemUnderTest {
17
+ public static void printSum (Collection<Integer > input ) {
18
+ final int sum = input. stream(). reduce((lhs, rhs) - > lhs + rhs). get();
19
+
20
+ System . out. println(sum);
21
+ }
22
+ }
23
+
24
+ try {
25
+ api. integers(). immutableLists(). withLimit(100 ). supplyTo(SystemUnderTest :: printSum);
26
+ } catch (TrialsFactoring . TrialException exception){
27
+ System . out. println(exception. getCause());
28
+ System . out. println(exception. provokingCase());
29
+ System . out. println(exception. recipe());
30
+ }
31
+ ```
5
32
6
33
## What? Why? ##
7
34
You can’t perform that action at this time.
0 commit comments