DERBY-6563: NOT elimination for CASE expressions is broken

backporting change #1592945 from trunk to 10.10 branch.  Had to resolve
conflicts and change code in tests to compile/run in pre-jdk15 environments.



git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/branches/10.10@1630946 13f79535-47bb-0310-9956-ffa450edef68