Skip to content

Instantly share code, notes, and snippets.

@jasper-lyons
Last active January 17, 2016 18:59
Show Gist options
  • Save jasper-lyons/26b9d50283de024c7850 to your computer and use it in GitHub Desktop.
Save jasper-lyons/26b9d50283de024c7850 to your computer and use it in GitHub Desktop.
List<int> weekendDays = Array.asList(1,7);
List<Thing> productiveThings = Array.asList(study, laundry, foodShopping, gym);
List<Thing> thingsDone = days.stream()
// Split infinite stream of days into those that are wednesdays and those that are not
.collect(Collectors.partitionBy(day -> weekendDays.contains(day.get(Calendar.DAY_OF_WEEK))))
.entrySet().stream().map(entry ->
// if day is not weekend and william isn't "busy"
return (!entry.getKey() && isQuoteBusyEndQuote(william))
? beProductive(william, productiveThings)
: beUnproductive(william, Array.asList(xenoblade));
).collect();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment