add sample java code