Add last implementation
Fix java errors and junit tests