GS Collections 4.2 Release

Raab, Donald Donald.Raab at gs.com
Mon Dec 2 15:41:05 PST 2013


I thought I would update this group on our latest release of GS Collections.  For those who haven't heard of it, GS Collections is a comprehensive open source Java Collections library, featuring rich functional style interfaces and compatibility with JDK collections.  Its features are fully lambda ready so you can try it out now with Java 8.  Trying GS Collections with lambdas will also demonstrate the synergies between lambdas and this style of API:  greatly increased code simplicity, readability and expressiveness as well as improved collection operation performance in some cases.

As of the 4.1 release, GS Collections is now available in Maven Central.  Release notes are available here:

https://github.com/goldmansachs/gs-collections/releases

GS Collections comes with a programming kata which is intended to help developers learn our APIs through a combination of educational material and hands-on exercises.  The kata can be found in GitHub here:

https://github.com/goldmansachs/gs-collections-kata

We've updated our Java 8 kata solutions branch to leverage the latest features in GSC 4.2.  We've also discovered a neat way to parameterize a method reference using our optimized (but lesser known) "With" methods (e.g. selectWith, collectWith, anySatisfyWith, detectWith, etc.).  You can see two examples of this in the kata solutions.  Method references are such a cool feature, our tendency is to want to use them as much as possible.  Being able to parameterize a method reference gives us even more opportunities to leverage this wonderful Java 8 feature.  Kudos and thanks to Oracle and the Java 8 Lambda developers on building this most excellent feature.

Here's a link to our kata solutions branch that leverages Java 8 lambdas and method references:

https://github.com/goldmansachs/gs-collections-kata/tree/solutions-java8

Several parameterized method reference examples are linked below.  Look for methods that end in "With" and take a Java 8 method reference along with a second parameter.

https://github.com/goldmansachs/gs-collections-kata/blob/solutions-java8/src/test/java/com/gs/collections/kata/Exercise1Test.java
https://github.com/goldmansachs/gs-collections-kata/blob/solutions-java8/src/test/java/com/gs/collections/kata/Exercise3Test.java
https://github.com/goldmansachs/gs-collections-kata/blob/solutions-java8/src/test/java/com/gs/collections/kata/Exercise5Test.java

With the release of GSC 4.2 we now have support for all primitive types including mutable, immutable, unmodifiable, synchronized and lazy across primitive Lists, Sets, Maps, Bags and Stacks.  You can transform from an object collection to any primitive collection type either eagerly or lazily, and back again.  We do not support primitive to primitive type conversions yet.

Our hope is that folks will further explore, test and provide feedback on the capabilities of Java 8 lambdas and method references with our extensive lambda ready APIs, especially with our primitive collections, before Java 8 is released in a few months.

Cheers,
Don








The Goldman Sachs Group, Inc. All rights reserved.
See http://www.gs.com/disclaimer/global_email for important risk disclosures, conflicts of interest and other terms and conditions relating to this e-mail and your reliance on information contained in it.  This message may contain confidential or privileged information.  If you are not the intended recipient, please advise us immediately and delete this message.  See http://www.gs.com/disclaimer/email for further information on confidentiality and the risks of non-secure electronic communication.  If you cannot access these links, please notify us by reply message and we will send the contents to you.





More information about the lambda-dev mailing list