[java/cs] Fix Unop + apply parameters. Closes #2281
[java] Tests some already closed issues, and closes #3123 by always casting the return type of functions with type parameters on Java. Closes #2282 . Closes #2540