[java] Creating a "logical exclusive or" operator in Java