class PartitionImpl implements Partition {

    protected final Map<Object, Color> colorMap;

    protected PartitionImpl() {
        this.colorMap = new HashMap<>();
    }

    @Override
    public Color getColor(Object value) {
        return colorMap.getOrDefault(value, Partition.DEFAULT_COLOR);
    }

    @Override
    public void setColor(Object value, Color color) {<FILL_FUNCTION_BODY>}

    @Override
    public void setColors(Graph graph, Color[] colors) {
        Collection sortedValues = getSortedValues(graph);
        Iterator itr = sortedValues.iterator();
        for (int i = 0; i < colors.length && itr.hasNext(); i++) {
            setColor(itr.next(), colors[i]);
        }
    }

    @Override
    public Collection getSortedValues(Graph graph) {
        List values = new ArrayList(getValues(graph));
        values.sort((o1, o2) -> {
            int c1 = count(o1, graph);
            int c2 = count(o2, graph);
            return Integer.compare(c2, c1);
        });
        return values;
    }

    public abstract boolean isValid(Graph graph);

    public abstract Class getValueType();

    public abstract int getVersion(Graph graph);
}

        if (color.equals(Partition.DEFAULT_COLOR)) {
            colorMap.remove(value);
        } else {
            colorMap.put(value, color);
        }
    
<no_super_class>