class HighestUriPrecedenceProvider extends SimplePrecedenceProvider {
        private static final long serialVersionUID = 5545297542888582745L;
        
        protected Histotable<Integer> enqueuedCounts = new Histotable<Integer>();
        public HighestUriPrecedenceProvider(int base) {
            super(base);
        }
        
        /* (non-Javadoc)
         * @see org.archive.crawler.frontier.precedence.PrecedenceProvider#tally(org.archive.modules.CrawlURI, org.archive.modules.fetcher.FetchStats.Stage)
         */
        @Override
        public void tally(CrawlURI curi, Stage stage) {<FILL_FUNCTION_BODY>}

        /* (non-Javadoc)
         * @see org.archive.crawler.frontier.precedence.SimplePrecedenceProvider#getPrecedence()
         */
        @Override
        public int getPrecedence() {
            // base plus highest URI still in queue
            synchronized (enqueuedCounts) {
                Integer delta = (enqueuedCounts.size() > 0)
                        ? enqueuedCounts.firstKey()
                        : 0;
                return super.getPrecedence() + delta;
            }
        }

        /*
         * @see org.archive.crawler.frontier.precedence.PrecedenceProvider#shortReportLegend()()
         */
        @Override
        public String shortReportLegend() {
            StringBuilder sb = new StringBuilder();
            sb.append(super.shortReportLegend());
            sb.append(":");
            synchronized (enqueuedCounts) {
                for (Integer p : enqueuedCounts.keySet()) {
                    sb.append(" p");
                    sb.append(p);
                }
            }
            return sb.toString(); 
        }

        @Override
        public void shortReportLineTo(PrintWriter writer) {
            boolean betwixt = false; 
            synchronized (enqueuedCounts) {
                for (Long count : enqueuedCounts.values()) {
                    if (betwixt)
                        writer.print(" ");
                    writer.print(count);
                    betwixt = true;
                }
            }
        }

    }

            switch(stage) {
            case SCHEDULED:
                // enqueued
                synchronized (enqueuedCounts) {
                    enqueuedCounts.tally(curi.getPrecedence());
                }
                break;
            case SUCCEEDED:
            case DISREGARDED:
            case FAILED:
                // dequeued
                synchronized (enqueuedCounts) {
                    enqueuedCounts.tally(curi.getPrecedence(), -1);
                }
                break;
            case RETRIED:
                // do nothing, already tallied
                break;
            }
        
<methods>public non-sealed void <init>() ,public int getBasePrecedence() ,public org.archive.spring.KeyedProperties getKeyedProperties() ,public void queueCreated(org.archive.crawler.frontier.WorkQueue) ,public void queueReevaluate(org.archive.crawler.frontier.WorkQueue) ,public void setBasePrecedence(int) <variables>protected org.archive.spring.KeyedProperties kp,private static final long serialVersionUID