Added first try on pure java traits. May have bugs.