A 2D Vector Graphics Library in WebGL
shadertoy.com2 pointsby wrnr0 comments
if timeslots.stream().matchNone(Timeslot::hasntEnded) {
new Timeslot()
}
Would be an improvement I guess. The way I found this code it was also wrapped in a @Transaction so it creates a new object in the database with spring magic. There was a lot of other things wrong with the code, that was not my point though. Lots of people just think FP better and of course in theory they are right but most people don't think for themselfs. timeslotRepo.findAll().stream().filter(timeslot->timeslot.getEndDate()==null).first().ifPresentOrElse(()->{}, ()->{new Timeslot(DateTime.now())})