add java implementation