Initial java implementation w. unit test