some algorithms
little kata with java8