class PeerGroup implements TransactionBroadcaster {

    static int maxOfMostFreq(List<Integer> items) {
        if (items.isEmpty())
            return 0;
        // This would be much easier in a functional language (or in Java 8).
        items = Ordering.natural().reverse().sortedCopy(items);
        LinkedList<Pair> pairs = new LinkedList<>();
        pairs.add(new Pair(items.get(0)));
        for (int item : items) {
            Pair pair = pairs.getLast();
            if (pair.item != item)
                pairs.add((pair = new Pair(item)));
            pair.count++;
        }
        // pairs now contains a uniquified list of the sorted inputs, with counts for how often that item appeared.
        // Now sort by how frequently they occur, and pick the most frequent. If the first place is tied between two,
        // don't pick any.
        Collections.sort(pairs);
        final Pair firstPair = pairs.get(0);
        if (pairs.size() == 1)
            return firstPair.item;
        final Pair secondPair = pairs.get(1);
        if (firstPair.count > secondPair.count)
            return firstPair.item;
        checkState(firstPair.count == secondPair.count);
        return 0;
    }

    public  PeerGroup(NetworkParameters params);
    public  PeerGroup(Context context);
    public  PeerGroup(NetworkParameters params, @Nullable AbstractBlockChain chain);
    public  PeerGroup(Context context, @Nullable AbstractBlockChain chain);
    public  PeerGroup(NetworkParameters params, @Nullable AbstractBlockChain chain, ClientConnectionManager connectionManager);
    private  PeerGroup(Context context, @Nullable AbstractBlockChain chain, ClientConnectionManager connectionManager);

}