| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Do you know how to use Java Stream API?
Apply you knowledge of streams, lambdas, method handlers and other functional Java things.
There are also some tasks that will make think even experienced programmers. Try to solve them all.
25 tasks are available now
Clone repository → implement methods → run tests → fix mistakes
Methods to implement are placed in class tasks.StreamTasks in src folder. Initially they are stubbed with standard UnsupportedOperationException (and tests know about that). You need to replace such lines with solution consists of stream flow or something related to it (description and hints for each task are provided).
It's prohibited to use standard cycles (for, while, do-while, recursion) at all and conditions (if, if-else, ...) out of stream operations. The main goal of this project is to teach you how to use functional approach in practice. One possible exclusion from pure functional paradigm is declaring and usage of local variables.
Due to this project is orientated to beginners no dependent libraries are required. If you know how to add dependencies and really know for what then you can do it manually (but, be pointed, all tasks can be solved using only standard Java library).
Main requirement is JVM of 11 version (or higher)
Run main method from tasks.StreamTasksMain class in your preferred IDE or run a script file test.(cmd|sh).
Flag -ea is required to enable assert key word for tests checker. Otherwise all tests will not be run properly.
Check program will run tests for all tasks and then write verdict for each of tasks.
Possible verdicts:
Until you solved all tasks with verdict accepted the program will finish with non-zero exit code.
You can run check program with argument example. For that add example word to passing arguments in IDE or to the end of running scripts: test.cmd example (for Windows) and ./test.sh example (for Unix)
There are some implemented tasks in class tasks.StreamTasksExample, so they would be tested in example mode.
Not guaranteed that implementation is correct or in optimal way ;)
In case you don't know how to solve some task than you can see solution in tasks.solution.StreamTasksSolution class in src folder. This class is used as reference solution to check answers, so you can copy-paste code to the task and this task will be accepted.
Try to avoid any interaction with solutions until you completed all tasks :)
You can also use tasks from this project for different challenges. For example, you can check how many tasks you can do in limited time or how much time you will need to solve them all, etc.
Version 0.1.0 is available here
Future plans:
| Back | FazBrowse Home | New Git URL |