Java fixes: check required parameters before using. use true name of headers, not java names

Fix issues with java codegen template
1) the string used for headers should be the original name, not the name transformed for use as a java variable. (so "Accept-Language" is used to define the header, but Accept_Language is the name of the variable. )
2) check require parameters, throw ApiException exception prior to use in creating the path, so it won't throw null pointer exceptions.

had to paper over some unit test failures to get the codegen to work - probably bad to bring over directly.