@SuppressWarnings("unchecked")
    @Override
    public boolean equals(Object that) {
        if (!(that instanceof PBag))
            return false;
        if (!(that instanceof MapPBag)) {
            // make that into a ImmutableMapBag
            that = MapPBag.empty().plus(that);
        }
        return this.map.equals(((MapPBag<?>) that).map);
    }