File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- stream-lambda
1+ Simple Kata for learning Java 8 Streams and Lambdas
22=============
33
4- Simple Kata for learning Java 8 Streams and Lambdas
4+ Class ` ListTransformer ` accepts a ` List ` as an argument and has three methods:
5+ ``` Java
6+ /**
7+ * This method should take the String List and sort all the String elements in ascending (ASCII) order.
8+ * @return The sorted values in ascending ASCII order.
9+ */
10+ public List<String > getSortedStrings();
11+
12+ /**
13+ * This method should take the String List and:
14+ * <ol >
15+ * <li >filter the elements that contains one or more digits;</li>
16+ * <li >transform (map) the remaining Strings into Integers;</li>
17+ * <li >sort the Integers in ascending order.</li>
18+ * </ol>
19+ * @return
20+ */
21+ public List<Integer > getSortedIntegers();
22+
23+ /**
24+ * This method should take the String List and:
25+ * <ol >
26+ * <li >filter the elements that contains one or more digits;</li>
27+ * <li >transform (map) the remaining Strings into Integers;</li>
28+ * <li >sort the Integers in descending order.</li>
29+ * </ol>
30+ * @return
31+ */
32+ public List<Integer > getSortedDescendingIntegers();
33+ ```
34+
35+ We have an accompanying JUnit test called ` ListTransformerTest ` to validate your code.
36+
37+ If you're not familiar with lambdas we encourage you to first make the tests pass using the imperative syntax.
38+ Then you can refactor your code with small steps and assure that your tests are still passing.
39+
40+ Enjoy and have nice lambdas! :-)
You can’t perform that action at this time.
0 commit comments