Adding .java file for the example