add java doc and modify tests
error draft