static B[] valuesArray(Class valueType, Map map) { if (map == null) null; synchronized(collectionMutex(map)) { int n = map.size(); B[] array = newArray(valueType, n); var it = valueIterator(map); for i to n: array[i] = it.next(); ret array; } }