Added better Java source example
Tidied up indentation and removed unused imports/fields