Add sample java code ; missing metric definition