/*
Fill the two output HashMap.
767009
private void getNetData() {
        int nTime = lastTimeDischarge.length;
        int length = lastTimeDischarge[0].length;
        HashMap<Integer, double[]> tmpHMDis = new LinkedHashMap<Integer, double[]>();
        HashMap<Integer, double[]> tmpHMFill = new LinkedHashMap<Integer, double[]>();
        // order the outpt.

        int netLength = networkPipes.length;
        double[] one = new double[netLength];
        double[] two = new double[netLength];
        for( int i = 0; i < netLength; i++ ) {
            one[i] = i;
            two[i] = networkPipes[i].getId();
        }

        QuickSortAlgorithm sort = new QuickSortAlgorithm(pm);
        sort.sort(two, one);

        for( int i = 0; i < length - 1; i++ ) {
            int index = (int) one[i];
            tmpHMDis.put(networkPipes[index].getId(), new double[]{lastTimeDischarge[0][index]});
            tmpHMFill.put(networkPipes[index].getId(), new double[]{lastTimeFillDegree[0][index]});

        }
        discharge.put(first, tmpHMDis);
        fillDegree.put(first, tmpHMFill);
        DateTime tmp = first;
        for( int i = 1; i < nTime; ++i ) {
            tmp = tmp.plusMinutes(dt);
            tmpHMDis = new LinkedHashMap<Integer, double[]>();
            tmpHMFill = new LinkedHashMap<Integer, double[]>();
            for( int j = 0; j < length - 1; j++ ) {
                int index = (int) one[j];
                tmpHMDis.put(networkPipes[index].getId(), new double[]{lastTimeDischarge[i][index]});
                tmpHMFill.put(networkPipes[index].getId(), new double[]{lastTimeFillDegree[i][index]});

            }
            discharge.put(tmp, tmpHMDis);
            fillDegree.put(tmp, tmpHMFill);
        }
    }
288265
public static <T> T fillBeanWithMap(Map<?, ?> map, T bean, CopyOptions copyOptions) {
		return fillBeanWithMap(map, bean, false, copyOptions);
	}
988480
public void populateMaps(){
		this.elementName2Element = new HashMap<String, Element>();
		this.isotopeName2Isotope = new HashMap<String, Isotope>();
		if(this.element != null){
			for(Element e:this.element){
				this.elementName2Element.put(e.getName(), e);
				if(e.getIsotopes() != null){
					for(Isotope i:e.getIsotopes()){
						this.isotopeName2Isotope.put(i.getName(), i);
					}
				}
			}
		}
	}
347344
private void fill() throws IOException {
    int i = in.read(buf, 0, buf.length);
    if (i > 0) {
      pos = 0;
      count = i;
    }
  }
1248104
@SuppressWarnings({"unchecked", "rawtypes"})
    private void populateMap(Map map, Node node) {
        Map.Entry entry = getMapEntry(node);
        if (entry != null) {
            map.put(entry.getKey(), entry.getValue());
        }
    }
824837
public SetMultimap<A, B> getKeyValueMultimap() {
    SetMultimap<A, B> map = HashMultimap.create();
    for (A key : keySet()) {
      for (B value : getValues(key)) {
        map.put(key, value);
      }
    }
    return map;
  }
298623
public static <S, T> Map<S, T> compactAndLockHashMap( HashMap<S, T> map )
  {
    if( map == null || map.isEmpty() )
    {
      return Collections.emptyMap();
    }

    if( map.size() == 1 )
    {
      Map.Entry<S, T> stEntry = map.entrySet().iterator().next();
      return Collections.singletonMap( stEntry.getKey(), stEntry.getValue() );
    }

    Map<S, T> newMap = new HashMap<S, T>( map.size(), 1 );
    newMap.putAll( map );
    return Collections.unmodifiableMap( newMap );
  }
634262
function fill(buffer, value, from, to) {
  for (let i = from; i < to; ++i) {
    buffer[i] = Number(value)
  }
}
523029
private function fill()
    {
        foreach ($this->grid as $r => $row) {
            foreach ($row as $c => $cell) {
                if ($cell === null) {
                    $this->grid[$r][$c] = $this->alphabet->randomLetter();
                }
            }
        }
        // fill them
    }
286861
public void copyValuesFromTo(Map<String, Object> otherMap, Map<String, Object> map) {
        getMapHelper().copyValuesFromTo(otherMap, map);
    }
91886
public static <K, V> Map<K, V> newHashMap(Map<? extends K, ? extends V> m) {
    return new HashMap<K, V>(m);
  }
1031952
public void fillVMIndex(TIntIntHashMap index, int p) {
        for (Node n : scope) {
            for (VM v : parent.getRunningVMs(n)) {
                index.put(v.id(), p);
            }
            for (VM v : parent.getSleepingVMs(n)) {
                index.put(v.id(), p);
            }
        }
        for (VM v : ready) {
            index.put(v.id(), p);
        }
    }
589162
function _fillFileTemplate(content, dataMap) {
	for (var key in dataMap) {
		//content = content.replace(key, dataMap[key]);
		content = _replaceAll(content, key, dataMap[key]);
	}

	return content;
}
951236
public static <K, V> HashMap<K, V> newHashMap(@NotNull final K[] keys, @NotNull final V[] values) {
		Validate.isTrue(keys.length == values.length, "keys.length is %d but values.length is %d", keys.length,
				values.length);

		HashMap<K, V> map = new HashMap<K, V>(keys.length * 2);

		for (int i = 0; i < keys.length; i++) {
			map.put(keys[i], values[i]);
		}

		return map;
	}
852429
private void populateMap(final int[] priKeyIndices) {
    final SketchIterator<ArrayOfStringsSummary> it = sketch.iterator();
    Arrays.fill(hashArr, 0L);
    Arrays.fill(priKeyArr, null);
    Arrays.fill(counterArr, 0);
    groupCount = 0;
    final int lgMapArrSize = Integer.numberOfTrailingZeros(mapArrSize);

    while (it.next()) {
      final String[] arr = it.getSummary().getValue();
      final String priKey = getPrimaryKey(arr, priKeyIndices, sep);
      final long hash = stringHash(priKey);
      final int index = hashSearchOrInsert(hashArr, lgMapArrSize, hash);
      if (index < 0) { //was empty, hash inserted
        final int idx = -(index + 1); //actual index
        counterArr[idx] = 1;
        groupCount++;
        priKeyArr[idx] = priKey;
      } else { //found, duplicate
        counterArr[index]++; //increment
      }
    }
    mapValid = true;
  }
676706
private Map<String, String> flatten(Map<String, ?> input) {
        Map<String, String> result = new HashMap<String, String>();

        for (Map.Entry<String, ?> entry : input.entrySet()) {
            for (Map.Entry<String, String> flattened : flatten(entry)) {
                if (flattened.getValue() != null) {
                    result.put(flattened.getKey(), flattened.getValue());
                }
            }
        }

        return result;
    }
852069
public static <K, V> Map<K, List<V>> nullToEmptyMultimap(Map<K, List<V>> newValue) {
    if (newValue == null) {
      return new HashMap<>();
    }
    return newValue;
  }