package ru.footmade.libnot;

public class NegationUtils {

    private static final Boolean TRUE = Boolean.valueOf(true);
    private static final Boolean FALSE = Boolean.valueOf(false);

    private static final HashMap cache;

    static {
        cache = new HashMap();
    }

    /**
     * Does logical negation
     * @param var a value which should be negated. Must be either true or false.
     * @return true, if an argument is false; false, if an argument is true.
     */
    public static boolean not(boolean var) throws IllegalArgumentException {
        final Boolean varObj = Boolean.valueOf(var);

        if (cache.containsKey(varObj)) {
            return cache.get(varObj);
        }

        if (varObj.equals(TRUE)) {
            cache.put(varObj, false);
            return false;
        } else if (varObj.equals(FALSE)) {
            cache.put(varObj, true);
            return true;
        } else {
            throw new IllegalArgumentException();
        }
    }
}

@@ -22,16 +22,65 @@
 ibnot;%0A%0A
+import java.util.HashMap;%0Aimport java.util.Map;%0A%0A
 public c
@@ -255,23 +255,37 @@
 c final 
-HashMap
+Map%3CBoolean, Boolean%3E
  cache;%0A
@@ -325,16 +325,18 @@
  HashMap
+%3C%3E
 ();%0A    

Fix compilation errors