added UDF java code