class PendingTokenOffsetsComparator implements Comparator<PendingToken> {

    /**
     * Singleton instance.
     */
    public static final PendingTokenOffsetsComparator INSTANCE =
        new PendingTokenOffsetsComparator();

    @Override
    public int compare(PendingToken o1, PendingToken o2) {<FILL_FUNCTION_BODY>}

    /** Private to enforce singleton. */
    private PendingTokenOffsetsComparator() {
    }
}

        // ASC by starting offset.
        int cmp = Integer.compare(o1.start, o2.start);
        if (cmp != 0) {
            return cmp;
        }
        // ASC by ending offset
        cmp = Integer.compare(o1.end, o2.end);
        return cmp;
    
<no_super_class>