The Eclipse Collections Code Katas

Learn the Eclipse Collections library by completing hands-on Java code katas.

What is Eclipse Collections?

Eclipse Collections is an open source Java collections library. Eclipse Collections has been evolving as a Java library since 2004. It was first released into open source as GS Collections in January 2012. It was later moved to the Eclipse Foundation in December 2015 and became Eclipse Collections.

What are the Eclipse Collections Katas?

The Eclipse Collections Katas are structured exercises organized into individual kata modules that will help you learn the Eclipse Collections library. There are currently six distinct code katas that make up the Eclipse Collections Kata Project on GitHub.

More doing, more learning

Over the past four years, four more code katas have been added to the Eclipse Collections Kata project. Each kata focuses on a different area of Eclipse Collections. The more Eclipse Collections katas you do, the more you will learn about Eclipse Collections.

Candy Kata

The Candy Kata was originally developed to teach Java developers about the Bag data structure available in Eclipse Collections.

Converter Method Kata

The Converter Method Kata started out as a blog that explained how to convert one collection type to another type using Eclipse Collections converter methods. Converter methods are methods that being with the prefix “to” and copy collections contents from one type to another. In order to convert a List to a Set in Eclipse Collections, you can call toSet on the List. The kinds of converters a developer can learn in this kata are as follows:

  • Convert object collections to ImmutableCollection types
  • Convert Java Streams to MutableCollection types using Collectors2
  • Convert Java Streams to ImmutableCollection types using Collectors2
  • Convert primitive collections to other primitive MutableCollection types

Top Methods Kata

The Top Methods Kata started out as a blog where I wanted to see how many of the Eclipse Collections methods I could include in a single method example. I decided to stop at 25 methods, even though there are a lot more in the RichIterable interface. We all have limited time, so I wanted to create a kata that a developer could complete that would expose them to the most commonly used methods in the Eclipse Collections API as quickly as possible.

Lost and Found Kata

Eclipse Collections is a huge library. The code base has over 1 million lines of code. This makes it a challenge to teach all of the amazing features available in the Eclipse Collections API to developers. A million lines of code is just too much code to just sit down and read. This rather large code base has 18 years of software engineering investment, including contributions from over 100 developers. There are many data structures and algorithms you will not find direct equivalents for in the JDK today.

README — What is in the Lost and Found Kata?

Do. Or do not. There is no Try.

I hope this blog motivates some developers to complete the Eclipse Collections katas. We are looking for more committers for the Eclipse Collections library. If you are interested in investing and committing time to your own learning and the development of the library, then I highly recommend completing the Lost and Found Kata. For more information on becoming a committer on a project managed at the Eclipse Foundation, check out this post on the Eclipse Foundation Wiki.

Java Champion. Creator of the Eclipse Collections OSS Java library (http://www.eclipse.org/collections/). Inspired by Smalltalk. Opinions are my own.