Issues/67 - generate expected exceptions in java templates when parameters are missing

the java templates, including the android-java versions, would use the required parameters prior to null checking.
This caused NullPointerExceptions to occur rather than the expected ApiException(400,...)

Move the checking code up and all is good.