Group the input pairs by the key of each pair.
@param listInput the list of pairs to group
@param <K> the key type
@param <V> the value type
@return a map representing a grouping of the
keys by the given input key type and list of values
in the grouping.
341177
public static <K,V> Map<K,List<V>> groupByKey(List<Pair<K,V>> listInput) {
        Map<K,List<V>> ret = new HashMap<>();
        for(Pair<K,V> pair : listInput) {
            List<V> currList = ret.get(pair.getFirst());
            if(currList == null) {
                currList = new ArrayList<>();
                ret.put(pair.getFirst(),currList);
            }

            currList.add(pair.getSecond());
        }

        return ret;
    }
169663
public static Map<String, String> mapProperties(final Map<String, String> input, final Description desc) {
        final Map<String, String> mapping = desc.getPropertiesMapping();
        if (null == mapping) {
            return input;
        }
        return performMapping(input, mapping, false);
    }
161578
public List<String> splitWithDefaultSplitStrategy(String input) {
        if (input == null) {
            throw new NullPointerException(makeNullArgumentErrorMsg("input"));
        }
        return defaultSplitStrategy().split(input, IGNORED);
    }
101308
private static List<TypeName> convert(List<? extends TypeMirror> input) {
		List<TypeName> result = new ArrayList<TypeName>();

		for (TypeMirror item : input) {
			result.add(TypeUtility.typeName(item));
		}

		return result;
	}
862242
public String put(String group, String key, String value) {
		return this.groupedMap.put(group, key, value);
	}
394000
public static <K> Map<K, Integer> rankMapOnIntegerValue(Map<K, Integer> inputMap) {
    Map<K, Integer> newMap = new TreeMap<K, Integer>(new IntegerValueComparator(inputMap));
    newMap.putAll(inputMap);

    Map<K, Integer> linkedMap = new LinkedHashMap<K, Integer>(newMap);
    return linkedMap;
  }
42171
public void putAllValues(Map<String, V> input) {
        for (Map.Entry<String, V> entry : input.entrySet()) {
            put(entry.getKey(), entry.getValue());
        }
    }
515432
public GroupedMap putAll(String group, Map<? extends String, ? extends String> m) {
		for (Entry<? extends String, ? extends String> entry : m.entrySet()) {
			this.put(group, entry.getKey(), entry.getValue());
		}
		return this;
	}
365419
@Override
    public Object map(Object input) {
        List<Long> list = (List<Long>) input;
        switch (mathOp) {
            case Add:
                long sum = 0;
                for (Long w : list)
                    sum += w;
                return new LongWritable(sum);
            case Subtract:
                return list.get(0) - list.get(1);
            case Multiply:
                long product = 1;
                for (Long w : list)
                    product *= w;
                return product;
            case Divide:
                return list.get(0) / list.get(1);
            case Modulus:
                return list.get(0) % list.get(1);
            case ReverseSubtract:
            case ReverseDivide:
            case ScalarMin:
            case ScalarMax:
            default:
                throw new RuntimeException("Invalid mathOp: " + mathOp); //Should never happen
        }
    }
194779
public static List<String> toList(String[] input) {
        List<String> ret = new ArrayList<>();
        for (int i = 0; i < input.length; i++)
            ret.add(input[i]);
        return ret;
    }
672694
public boolean addAll(K key, List<V> list) {
        return getOrPutGetNewList(key).addAll(list);
    }
970547
public void setInputs(Collection<String> inputs) {
    List<String> newInputs = new ArrayList<String>();
    if (inputs != null) {
      newInputs.addAll(inputs);
    }
    this.inputs = newInputs;
  }
1265133
public static <K, V> List<Map<K, V>> listify(ObjectMapper mapper, Object source, Class<K> targetKeyType, Class<V> targetValueType) {
        return (List<Map<K, V>>) collectify(mapper, source, List.class, targetKeyType, targetValueType);
    }
1162428
public static GroupByBuilder<List<?>> groupBy(Expression<?>... keys) {
        return new GroupByBuilder<List<?>>(Projections.list(keys));
    }
985732
public static Map<String, Object> read(StreamingInput input)
		throws IOException
	{
		Token next = input.peek();
		if(next == null) return Collections.emptyMap();

		switch(next)
		{
			case LIST_START:
			case LIST_END:
			case OBJECT_END:
			case VALUE:
			case NULL:
				throw new SerializationException("Error in configuration file, should be in in key, value format");
		}

		return readMap(input);
	}
752588
public void mapInputToOutput(ValueNumber input, ValueNumber output) {
        BitSet inputSet = getInputSet(output);
        inputSet.set(input.getNumber());
        if (DEBUG) {
            System.out.println(input.getNumber() + "->" + output.getNumber());
            System.out.println("Input set for " + output.getNumber() + " is now " + inputSet);
        }
    }
691856
public void run(List<Record> input, List<Record> output) {
        if (input.size() < 0) {
            fail("input size is 0");
        }
        driver.setConfiguration(conf);

        Key key = input.get(0).getKey();
        boolean groupingNothing = input.get(0).isGroupingNothing();

        List<Writable> values = new ArrayList<Writable>();
        for (Record record : input) {
            values.add(record.isValueNothing() ? NullWritable.get() : record.getValue());
        }

        driver.withInput(groupingNothing ? NullWritable.get() : key,
                         values);

        if (output != null) {
            for (Record r : output) {
                driver.withOutput(r.isGroupingNothing() ? NullWritable.get() : r.getKey(),
                                  r.isValueNothing() ? NullWritable.get() : r.getValue());
            }
        }

        driver.runTest();
    }