Code example for SortedMap

Methods: firstKey, isEmpty, tailMap

0
     *  
     * @param entryId 
     * @return 
     */ 
    long getNextEnsembleChange(long entryId) {
        SortedMap<Long, ArrayList<InetSocketAddress>> tailMap = ensembles.tailMap(entryId + 1);
 
        if (tailMap.isEmpty()) {
            return -1; 
        } else { 
            return tailMap.firstKey();
        } 
    } 
 
    /** 
     * Generates a byte array based on a LedgerConfig object received. 
     *  
     * @param config 
     *            LedgerConfig object 
     * @return byte[] 
     */