Traits provide a mechanism for fine-grained code reuse to overcome the limitations of class-based inheritance.
A trait is a set of methods which is completely independent from any class hierarchy and can be flexibly used to build other traits or classes by means of a suite of composition operations.

Xtraitj is an implementation of traits completely compatible with Java. Single parts of a project can be refactored to use traits, without requiring a complete rewrite of the whole existing code-base.

It is implemented in Xtext and Xbase.