Skip to content

Instantly share code, notes, and snippets.

@nniesen
Last active June 8, 2020 14:28
Show Gist options
  • Save nniesen/e1e6b945a3b9dc27e0688c70306ca274 to your computer and use it in GitHub Desktop.
Save nniesen/e1e6b945a3b9dc27e0688c70306ca274 to your computer and use it in GitHub Desktop.
Random Notes
javascript:(function(){
  //Statements returning a non-undefined type, e.g. assignments
  return null;
})();

Streams

Arrays.asList(values).stream();
Stream.of(values).map(String::valueOf).collect(Collectors.joining(",", "[", "]"));

Spock

Array assertion in Spock

companyList.name.sort() == ["First", "Second"].sort()
companyList.name as Set == ["First", "Second"] as Set // Only works if no duplicates

Fluent with Inheritance

The Dangers of Correlating Subtype Polymorphism with Generic Polymorphism

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment