LinkedHashMap indicates stored order, important for context
161978
@SuppressWarnings("PMD.LooseCoupling")
    public static LinkedHashMap<String, Type> createGenericsMap(final Class<?> type,
                                                                final List<? extends Type> generics) {
        final TypeVariable<? extends Class<?>>[] params = type.getTypeParameters();
        if (params.length != generics.size()) {
            throw new IllegalArgumentException(String.format(
                    "Can't build generics map for %s with %s because of incorrect generics count",
                    type.getSimpleName(), Arrays.toString(generics.toArray())));
        }
        final LinkedHashMap<String, Type> res = new LinkedHashMap<String, Type>();
        int i = 0;
        for (TypeVariable var : params) {
            res.put(var.getName(), generics.get(i++));
        }
        // add possible outer class generics to avoid unknown generics
        return GenericsResolutionUtils.fillOuterGenerics(type, res, null);
    }
517819
public static <K, V> LinkedHashMap<K, V> sortByEntry(Map<K, V> map, Comparator<Map.Entry<K, V>> comparator) {
		return sortToMap(map.entrySet(), comparator);
	}
1228824
public static boolean organizeAssociationMapByRowKey(
			org.hibernate.ogm.model.spi.Association association,
			AssociationKey key,
			AssociationContext associationContext) {

		if ( association.isEmpty() ) {
			return false;
		}

		if ( key.getMetadata().getRowKeyIndexColumnNames().length != 1 ) {
			return false;
		}

		Object valueOfFirstRow = association.get( association.getKeys().iterator().next() )
				.get( key.getMetadata().getRowKeyIndexColumnNames()[0] );

		if ( !( valueOfFirstRow instanceof String ) ) {
			return false;
		}

		// The list style may be explicitly enforced for compatibility reasons
		return getMapStorage( associationContext ) == MapStorageType.BY_KEY;
	}
1012545
private static LinkedHashMap<String, KryoRegistration> buildKryoRegistrations(
			Class<?> serializedType,
			LinkedHashSet<Class<?>> registeredTypes,
			LinkedHashMap<Class<?>, Class<? extends Serializer<?>>> registeredTypesWithSerializerClasses,
			LinkedHashMap<Class<?>, ExecutionConfig.SerializableSerializer<?>> registeredTypesWithSerializers) {

		final LinkedHashMap<String, KryoRegistration> kryoRegistrations = new LinkedHashMap<>();

		kryoRegistrations.put(serializedType.getName(), new KryoRegistration(serializedType));

		for (Class<?> registeredType : checkNotNull(registeredTypes)) {
			kryoRegistrations.put(registeredType.getName(), new KryoRegistration(registeredType));
		}

		for (Map.Entry<Class<?>, Class<? extends Serializer<?>>> registeredTypeWithSerializerClassEntry :
				checkNotNull(registeredTypesWithSerializerClasses).entrySet()) {

			kryoRegistrations.put(
					registeredTypeWithSerializerClassEntry.getKey().getName(),
					new KryoRegistration(
							registeredTypeWithSerializerClassEntry.getKey(),
							registeredTypeWithSerializerClassEntry.getValue()));
		}

		for (Map.Entry<Class<?>, ExecutionConfig.SerializableSerializer<?>> registeredTypeWithSerializerEntry :
				checkNotNull(registeredTypesWithSerializers).entrySet()) {

			kryoRegistrations.put(
					registeredTypeWithSerializerEntry.getKey().getName(),
					new KryoRegistration(
							registeredTypeWithSerializerEntry.getKey(),
							registeredTypeWithSerializerEntry.getValue()));
		}

		// add Avro support if flink-avro is available; a dummy otherwise
		AvroUtils.getAvroUtils().addAvroGenericDataArrayRegistration(kryoRegistrations);

		return kryoRegistrations;
	}
184414
def get_context_data(self, **kwargs):
        
        context = super(SmartListView, self).get_context_data(**kwargs)

        # our linkable fields
        self.link_fields = self.derive_link_fields(context)

        # stuff it all in our context
        context['link_fields'] = self.link_fields

        # our search term if any
        if 'search' in self.request.GET:
            context['search'] = self.request.GET['search']

        # our ordering field if any
        order = self.derive_ordering()
        if order:
            if order[0] == '-':
                context['order'] = order[1:]
                context['order_asc'] = False
            else:
                context['order'] = order
                context['order_asc'] = True

        return context
1082338
public void getOrderedSenses(final List<String> mfsList,
      final TreeMultimap<Integer, String> mfsResultsMap) {
    if (!mfsList.isEmpty()) {
      for (final String mfsResult : mfsList) {
        final String[] mfsEntry = mfsResult.split("#");
        mfsResultsMap.put(Integer.valueOf(mfsEntry[0]), mfsEntry[1]);
      }
    }
  }
497100
function closeOrderContext (select) {
    // only operate if in order context
    if (select.context !== 'order') {
        return
    }
    // debug
    debug('closeOrderContext', select.contextData)
    // get columns to order by
    var columns = select.contextData.columns
    // must have columns in order to create order statement
    if (!Array.isArray(columns) || !columns.length) {
        // there is a direction with no column or there
        // are no order clauses in query then throw error
        if (!select.query.order || select.query.order.length === 0 || select.contextData.direction) {
            throwError('order must have columns', select)
        }
        // there is nothing in context that needs to be added to query
        else {
            return
        }
    }
    // if there is a direction then add to columns
    if (select.contextData.direction) {
        columns.push(select.contextData.direction)
    }
    // make sure query has order
    if (!select.query.order) {
        select.query.order = []
    }
    // add order caluse to query
    select.query.order.push(columns)
    // reset contextData
    select.contextData = {}
}
372568
public static String getMappedTypeDefined(int order, FieldType type, String express, boolean isList,
            boolean isMap) {
        StringBuilder code = new StringBuilder();
        String fieldName = getFieldName(order);
        if ((type == FieldType.STRING || type == FieldType.BYTES) && !isList) {
            // add null check
            code.append("com.google.protobuf.ByteString ").append(fieldName).append(" = null")
                    .append(CodeGenerator.JAVA_LINE_BREAK);
            code.append("if (!CodedConstant.isNull(").append(express).append(")) {").append(CodeGenerator.LINE_BREAK);

            String method = "copyFromUtf8";
            if (type == FieldType.BYTES) {
                method = "copyFrom";
            }
            code.append(fieldName).append(" = com.google.protobuf.ByteString.").append(method).append("(")
                    .append(express).append(")").append(CodeGenerator.JAVA_LINE_BREAK);
            code.append("}").append(CodeGenerator.LINE_BREAK);
            return code.toString();
        }
        // add null check
        String defineType = type.getJavaType();
        if (isList) {
            defineType = "List";
        } else if (isMap) {
            defineType = "Map";
        }
        code.setLength(0);
        code.append(defineType).append(" ").append(fieldName).append(" = null").append(CodeGenerator.JAVA_LINE_BREAK);
        code.append("if (!CodedConstant.isNull(").append(express).append(")) {").append(CodeGenerator.LINE_BREAK);
        code.append(fieldName).append(" = ").append(express).append(CodeGenerator.JAVA_LINE_BREAK);
        code.append("}").append(CodeGenerator.LINE_BREAK);
        return code.toString();
    }
862554
private static String getOrderedMapString(Map<Object, Object> map) {
		ArrayList<String> list = new ArrayList<String>();
		for (Map.Entry<Object, Object> entry : map.entrySet()) {
			if (entry.getValue() != null) {
				Object key = entry.getKey();
				Object value = entry.getValue();
				String objectString = getObjectString(value);
				if (!StringUtils.isEmpty(objectString)) {
					list.add(getObjectString(key) + "=" + objectString + "&");
				}

			}
		}
		int size = list.size();
		String[] arrayToSort = list.toArray(new String[size]);
		Arrays.sort(arrayToSort, String.CASE_INSENSITIVE_ORDER);
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < size; i++) {
			sb.append(arrayToSort[i]);
		}
		return "{" + sb.toString() + "}";
	}
1013119
@Override
    public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException {
	out.writeObject(new LinkedHashMap(this));
    }
467890
@CheckForNull
  public LinkedHashMap<String, Long> get(String facetName) {
    return facetsByName.get(facetName);
  }
697505
private E firstDataItem() {
        for (Node p = head; p != null; p = succ(p)) {
            Object item = p.item;
            if (p.isData) {
                if (item != null && item != p)
                    return LinkedTransferQueue.<E>cast(item);
            }
            else if (item == null)
                return null;
        }
        return null;
    }
1058939
private static Map<String, Object> getMap(Object obj) {
    // Using a LinkedHashMap to maintain the original order of insertions. This is done to help
    // with handling unused parameters and makes testing easier as well.
    Map<String, Object> map = new LinkedHashMap<String, Object>();
    for (Map.Entry<String, Object> entry : Data.mapOf(obj).entrySet()) {
      Object value = entry.getValue();
      if (value != null && !Data.isNull(value)) {
        map.put(entry.getKey(), value);
      }
    }
    return map;
  }
1093975
private Context currentContext()
   {
      LinkedList<Context> stack = threadContexts.get();

      if (stack != null && !stack.isEmpty())
      {
         return stack.getLast();
      }

      return null;
   }
21754
private SortedMap<Integer, List<AutocompleteResultsModel>> getCleanedAndSortedMapResults(
            ConcurrentMap<String, List<Tuple<SearchResult, String>>> resultsMap,
            int maxTextLength) {
        SortedMap<Integer, List<AutocompleteResultsModel>> prioritizedResultsMap =
                createAutocompletePriorityMap();

        // Put the results into the map of <priority,list>
        for (Map.Entry<String, List<Tuple<SearchResult, String>>> entry : resultsMap.entrySet()) {
            for (Tuple<SearchResult, String> tupleSearchResult : entry.getValue()) {
                SearchResult searchResult = tupleSearchResult.getFirst();
                List<String> resultTypes = searchResult.getType();
                // If the search result doesn't have a type defined, use the undefined result type.
                if (resultTypes.size() == 0) {
                    resultTypes = UNDEFINED_SEARCH_RESULT_TYPE;
                }
                for (String category : resultTypes) {
                    // Exclude the result if it is a result type that's in the ignore list.
                    if (!autocompleteIgnoreResultTypes.contains(category)) {
                        int priority = calculatePriorityFromCategory(category);
                        AutocompleteResultsModel result =
                                new AutocompleteResultsModel(
                                        cleanAndTrimString(searchResult.getTitle(), maxTextLength),
                                        cleanAndTrimString(
                                                searchResult.getSummary(), maxTextLength),
                                        tupleSearchResult.getSecond(),
                                        category);
                        prioritizedResultsMap.get(priority).add(result);
                    }
                }
            }
        }
        return prioritizedResultsMap;
    }
785941
private static <K, V> ImmutableMap<K, V> filterMapToKeysPreservingOrder(
      final ImmutableMap<? extends K, ? extends V> map, Iterable<? extends K> keys) {
    final ImmutableMap.Builder<K, V> ret = ImmutableMap.builder();
    for (final K key : keys) {
      final V value = map.get(key);
      checkArgument(value != null, "Key " + key + " not in map");
      ret.put(key, value);
    }
    return ret.build();
  }
1119828
function SortedSet(source) {
  HashMap.call(this);
  this._rtype = TYPE_NAMES.ZSET;
  if(source) {
    for(var k in source) {
      this.setKey(k, source[k]);
    }
  }
}