Sample Usage
Corrected comments for java doc
Added comments.
Support for required added.
Added checking of required.