public static <K, V> Map<K, V> drop(Map<K, V> self, int num) {
        if (self.size() <= num) {
            return createSimilarMap(self);
        }
        if (num == 0) {
            return cloneSimilarMap(self);
        }
        Map<K, V> ret = createSimilarMap(self);
        for (K key : self.keySet()) {
            if (num-- <= 0) {
                ret.put(key, self.get(key));
            }
        }
        return ret;
    }
public static < K , V > Map < K , V > drop ( Map < K , V > self , int num ) { if ( self . size ( ) <= num ) { return createSimilarMap ( self ) ; } if ( num == 0 ) { return cloneSimilarMap ( self ) ; } Map < K , V > ret = createSimilarMap ( self ) ; for ( K key : self . keySet ( ) ) { if ( num -- <= 0 ) { ret . put ( key , self . get ( key ) ) ; } } return ret ; }
Drops the given number of key/value pairs from the head of this map if they are available.
<pre class="groovyTestCase">
def strings = [ 'a':10, 'b':20, 'c':30 ]
assert strings.drop( 0 ) == [ 'a':10, 'b':20, 'c':30 ]
assert strings.drop( 2 ) == [ 'c':30 ]
assert strings.drop( 5 ) == [:]
</pre>
If the map instance does not have ordered keys, then this function could drop a random <code>num</code>
entries. Groovy by default uses LinkedHashMap, so this shouldn't be an issue in the main.

@param self the original map
@param num  the number of elements to drop from this map
@return a map consisting of all key/value pairs of this map except the first
<code>num</code> ones, or else the empty map, if this map has
less than <code>num</code> elements.
@since 1.8.1