public boolean equals(Object other) {
        if (other instanceof Flag)
            return ((Flag) other).key == this.key &&
                    ((Flag) other).value.equals(this.value);

        if (other instanceof Character)
            return ((char) other) == this.key;

        return false;
    }