Add Java implementation