class ClusterCoefficientAlgorithm extends AbstractCommAlgorithm {

    public static final String ALGO_NAME = "cluster_coefficient";

    @Override
    public String name() {
        return ALGO_NAME;
    }

    @Override
    public void checkParameters(Map<String, Object> parameters) {
        direction(parameters);
        degree(parameters);
        workersWhenBoth(parameters);
    }

    @Override
    public Object call(UserJob<Object> job, Map<String, Object> parameters) {
        int workers = workersWhenBoth(parameters);
        try (Traverser traverser = new Traverser(job, workers)) {
            return traverser.clusterCoefficient(direction(parameters), degree(parameters));
        }
    }

    protected static int workersWhenBoth(Map<String, Object> parameters) {<FILL_FUNCTION_BODY>}

    private static class Traverser extends TriangleCountAlgorithm.Traverser {

        public Traverser(UserJob<Object> job, int workers) {
            super(job, ALGO_NAME, workers);
        }

        public Object clusterCoefficient(Directions direction, long degree) {
            Map<String, Long> results = this.triangles(direction, degree);
            results = InsertionOrderUtil.newMap(results);

            long triangles = results.remove(KEY_TRIANGLES);
            long triads = results.remove(KEY_TRIADS);
            assert triangles <= triads;
            double coefficient = triads == 0L ? 0d : 1d * triangles / triads;

            @SuppressWarnings({"unchecked", "rawtypes"})
            Map<String, Double> converted = (Map) results;
            converted.put("cluster_coefficient", coefficient);

            return results;
        }
    }
}

        Directions direction = direction(parameters);
        int workers = workers(parameters);
        E.checkArgument(direction == Directions.BOTH || workers <= 0,
                        "The workers must be not set when direction!=BOTH, " +
                        "but got workers=%s and direction=%s",
                        workers, direction);
        return workers;
    
<methods>public non-sealed void <init>() ,public java.lang.String category() <variables>private static final int MAX_TIMES