Last active
January 17, 2016 18:59
-
-
Save jasper-lyons/26b9d50283de024c7850 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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