public static IPool.Controller utilizationController(final double targetUtilization, final int maxObjectsPerKey, final int maxTotalObjects) {

        return new IPool.Controller() {
            public boolean shouldIncrement(Object key, int objectsForKey, int totalObjects) {
                return (objectsForKey < maxObjectsPerKey) && (totalObjects < maxTotalObjects);
            }

            public Map adjustment(Map stats) {
                Map adj = new HashMap();

                for (Object e : stats.entrySet()) {
                    Map.Entry entry = (Map.Entry) e;
                    Stats s = (Stats) entry.getValue();
                    int numWorkers = s.getNumWorkers();
                    double correction = s.getUtilization(1.0) / targetUtilization;
                    int n = (int) Math.ceil(s.getNumWorkers() * correction) - numWorkers;

                    adj.put(entry.getKey(), new Integer(n));
                }
                return adj;
            }
        };
    }