Example of a partitioning method

Scala implementation much cleaner because of HOF and implicits
Add equals/hashcode/toString in both classes
default arguments
multiple inheritance