adding java sample