Java sample for resthooks