class PartitionCountBuilder implements CategoryBuilder {

    private final static Category PARTITION_COUNT = new Category(
        NbBundle.getMessage(PartitionCountBuilder.class, "PartitionCountBuilder.name"),
        null,
        FilterLibrary.ATTRIBUTES);

    @Override
    public Category getCategory() {
        return PARTITION_COUNT;
    }

    @Override
    public FilterBuilder[] getBuilders(Workspace workspace) {<FILL_FUNCTION_BODY>}

    private static class PartitionCountFilterBuilder extends AbstractAttributeFilterBuilder {

        private final Partition partition;

        public PartitionCountFilterBuilder(Partition partition) {
            super(partition.getColumn(),
                PARTITION_COUNT,
                NbBundle.getMessage(PartitionCountBuilder.class, "PartitionCountBuilder.description"),
                null);
            this.partition = partition;
        }

        @Override
        public PartitionCountFilter getFilter(Workspace workspace) {
            AppearanceModel am = Lookup.getDefault().lookup(AppearanceController.class).getModel(workspace);
            if (AttributeUtils.isNodeColumn(column)) {
                return new PartitionCountFilter.Node(am, partition);
            } else {
                return new PartitionCountFilter.Edge(am, partition);
            }
        }

        @Override
        public JPanel getPanel(Filter filter) {
            RangeUI ui = Lookup.getDefault().lookup(RangeUI.class);
            if (ui != null) {
                return ui.getPanel((PartitionCountFilter) filter);
            }
            return null;
        }
    }

    public static abstract class PartitionCountFilter<K extends Element> extends AbstractAttributeFilter<K>
        implements RangeFilter {

        protected final AppearanceModel appearanceModel;
        protected Partition partition;
        private Range range;

        public PartitionCountFilter(AppearanceModel appearanceModel, Partition partition) {
            super(NbBundle.getMessage(PartitionCountBuilder.class, "PartitionCountBuilder.name"),
                partition.getColumn());
            this.partition = partition;
            this.appearanceModel = appearanceModel;

            //Add property
            addProperty(Range.class, "range");
        }

        @Override
        public boolean init(Graph graph) {
            return partition != null && partition.getColumn() != null;
        }

        @Override
        public boolean evaluate(Graph graph, Element element) {
            Object p = partition.getValue(element, graph);
            int partCount = partition.count(p, graph);
            return range.isInRange(partCount);
        }

        @Override
        public void finish() {
        }

        @Override
        public Number[] getValues(Graph graph) {
            if (init(graph)) {
                Collection vals = partition.getValues(graph);
                Integer[] values = new Integer[vals.size()];
                int i = 0;
                for (Object v : vals) {
                    values[i++] = partition.count(v, graph);
                }
                return values;
            } else {
                return new Integer[0];
            }
        }

        @Override
        public FilterProperty getRangeProperty() {
            return getProperties()[1];
        }

        public Range getRange() {
            return range;
        }

        public void setRange(Range range) {
            this.range = range;
        }

        public Column getColumn() {
            return partition.getColumn();
        }

        @Override
        public void setColumn(Column column) {
        }

        public static class Node extends PartitionCountFilter<org.gephi.graph.api.Node> implements NodeFilter {

            public Node(AppearanceModel appearanceModel, Partition partition) {
                super(appearanceModel, partition);
            }

            @Override
            public void setColumn(Column column) {
                // Bugfix #2519
                if(partition == null || partition.getColumn() != column) {
                    appearanceModel.getNodeFunctions();
                    this.partition = appearanceModel.getNodePartition(column);
                }
            }
        }

        public static class Edge extends PartitionCountFilter<org.gephi.graph.api.Edge> implements EdgeFilter {

            public Edge(AppearanceModel appearanceModel, Partition partition) {
                super(appearanceModel, partition);
            }

            @Override
            public void setColumn(Column column) {
                // Bugfix #2519
                if(partition == null || partition.getColumn() != column) {
                    appearanceModel.getEdgeFunctions();
                    this.partition = appearanceModel.getEdgePartition(column);
                }
            }
        }
    }
}

        List<FilterBuilder> builders = new ArrayList<>();
        GraphModel gm = Lookup.getDefault().lookup(GraphController.class).getGraphModel(workspace);
        AppearanceModel am = Lookup.getDefault().lookup(AppearanceController.class).getModel(workspace);

        //Force refresh
        am.getNodeFunctions();
        am.getEdgeFunctions();

        for (Column nodeCol : gm.getNodeTable()) {
            if (!nodeCol.isProperty()) {
                Partition partition = am.getNodePartition(nodeCol);
                if (partition != null) {
                    PartitionCountFilterBuilder builder = new PartitionCountFilterBuilder(partition);
                    builders.add(builder);
                }
            }
        }

        for (Column edgeCol : gm.getEdgeTable()) {
            if (!edgeCol.isProperty()) {
                Partition partition = am.getEdgePartition(edgeCol);
                if (partition != null) {
                    PartitionCountFilterBuilder builder = new PartitionCountFilterBuilder(partition);
                    builders.add(builder);
                }
            }
        }

        return builders.toArray(new FilterBuilder[0]);
    
<no_super_class>