add java sample