public T nextReady(long systemCurrentTimeMillis) {
        if (delayed.size() == 0) {
            return null;
        }

        // no ready objects
        if (delayed.firstKey() > systemCurrentTimeMillis) {
            return null;
        }

        Entry<Long, Object[]> entry = delayed.pollFirstEntry();
        Object[] values = entry.getValue();

        @SuppressWarnings("unchecked")
        T value = (T) values[0];

        // if this map entry had multiple values, put all but one
        // of them back
        if (values.length > 1) {
            int prevLength = values.length;
            values = Arrays.copyOfRange(values, 1, values.length);
            assert(values.length == prevLength - 1);
            delayed.put(entry.getKey(), values);
        }

        m_size--;
        return value;
    }
public T nextReady ( long systemCurrentTimeMillis ) { if ( delayed . size ( ) == 0 ) { return null ; } if ( delayed . firstKey ( ) > systemCurrentTimeMillis ) { return null ; } Entry < Long , Object [ ] > entry = delayed . pollFirstEntry ( ) ; Object [ ] values = entry . getValue ( ) ; @ SuppressWarnings ( "unchecked" ) T value = ( T ) values [ 0 ] ; if ( values . length > 1 ) { int prevLength = values . length ; values = Arrays . copyOfRange ( values , 1 , values . length ) ; assert ( values . length == prevLength - 1 ) ; delayed . put ( entry . getKey ( ) , values ) ; } m_size -- ; return value ; }
Return the next object that is safe for delivery or null
if there are no safe objects to deliver.

Null response could mean empty, or could mean all objects
are scheduled for the future.

@param systemCurrentTimeMillis The current time.
@return Object of type T.