Mostly Java code - leJOS NXT-J