Skip to content

Instantly share code, notes, and snippets.

@sizovs
Last active September 27, 2018 18:39
Show Gist options
  • Save sizovs/82a81c3c888ed9fcf76699e9ea04f097 to your computer and use it in GitHub Desktop.
Save sizovs/82a81c3c888ed9fcf76699e9ea04f097 to your computer and use it in GitHub Desktop.
// confusing (a bit), but clear from the return type
user.ban(Period period); // void
user.ban() // return s ban
// solution:
user.currentBan();
---
### V1
Authentication authentication = new Authentication(credentials);
authentication.token() throws ...
### V2
AuthenticationToken token = new AuthenticationToken(credentials) // throws...
---
Suppliers.memoize(vault::verySecure);
---
users.sort(comparing(User::getId));
nickName
.map(nick -> firstName + " <" + nick + "> " + lastName)
.orElse(firstName + " " + lastName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment