construct map for collection of criteria object where the key is
Criteria.getId

@param aPrimaryKeys
the primary keys
@return the map Criteria is the value and Criteria.getId is the key
503168
public static Map<Integer, PrimaryKey> constructPrimaryKeyMap(Collection<PrimaryKey> aPrimaryKeys)
	{
		if (aPrimaryKeys == null)
			return null;

		Map<Integer, PrimaryKey> map = new HashMap<Integer, PrimaryKey>(aPrimaryKeys.size());
		PrimaryKey primaryKey = null;
		for (Iterator<PrimaryKey> i = aPrimaryKeys.iterator(); i.hasNext();)
		{
			primaryKey = (PrimaryKey) i.next();
			map.put(Integer.valueOf(primaryKey.getPrimaryKey()), primaryKey);
		}
		return map;
	}
993119
public static <K> ImmutableSet<K> allMultimapKeys(final Iterable<? extends Multimap<K, ?>> multimaps) {
    final ImmutableSet.Builder<K> builder = ImmutableSet.builder();

    for (final Multimap<K, ?> multimap : multimaps) {
      builder.addAll(multimap.keySet());
    }

    return builder.build();
  }
1087235
function matchPrimaryKeys(model) {
    return model.primaryKeyAttributes.map(
        function(name) { return util.format('%s = NEW.%s', name, name)})
        .join(' AND ');
  }
389078
public static <K, V> ImmutableSet<K> allKeys(final Iterable<? extends Map<K, V>> maps) {
    final ImmutableSet.Builder<K> builder = ImmutableSet.builder();

    for (final Map<K, V> map : maps) {
      builder.addAll(map.keySet());
    }

    return builder.build();
  }
498672
public static <K, V> List<V> getIfPresentForEach(final Map<K, V> map, final Collection<?> keys) {
        if (N.isNullOrEmpty(map) || N.isNullOrEmpty(keys)) {
            return new ArrayList<>(0);
        }

        final List<V> result = new ArrayList<>(keys.size());
        V val = null;

        for (Object key : keys) {
            val = map.get(key);

            if (val != null || map.containsKey(key)) {
                result.add(val);
            }
        }

        return result;
    }
1132038
public Set<DOCUMENT> query(Iterable<KEY> keys) {
      return query(keys, d -> true);
   }
505859
public static Map<String, ImageArchiveManifestEntry> mapEntriesById(Iterable<ImageArchiveManifestEntry> entries) {
        Map<String, ImageArchiveManifestEntry> mapped = new LinkedHashMap<>();

        for(ImageArchiveManifestEntry entry : entries) {
            mapped.put(entry.getId(), entry);
        }

        return mapped;
    }
347515
@Override
    public Map<String, FieldTypes> get(final Collection<String> fieldNames) {
        return get(fieldNames, ImmutableSet.of());
    }
411030
public X getPrimaryID(T entity) {
		if(mappingContext == null || conversionService == null) {
			fetchMappingContextAndConversionService();
		}

		MongoPersistentEntity<?> persistentEntity = mappingContext.getPersistentEntity(entity.getClass());
		MongoPersistentProperty idProperty = persistentEntity.getIdProperty();
		if(idProperty == null) {
			return null;
		}
		
//		X idValue = BeanWrapper.create(entity, conversionService).getProperty(idProperty, this.primaryIDClass);
		X idValue = (X) this.mappingContext.getPersistentEntity(this.entityClass).getPropertyAccessor(entity).getProperty(idProperty);
		return idValue;
	}
533286
public Map<String, Set<String>> queriesForIds(Collection<String> ids) {
        Set<String> idsWithParents = getIdsForIdsWithAncestors(ids);
        Map<String, Set<String>> queries = new HashMap<String, Set<String>>();
        for (String id : idsWithParents) {
            queries.put(id, getIdsForIdWithDescendants(id));
        }
        return queries;
    }
1316560
public AbstractSpecWithPrimaryKey<T> withPrimaryKey(String hashKeyName, Object hashKeyValue) {
        if (hashKeyName == null)
            throw new IllegalArgumentException();
        withPrimaryKey(new PrimaryKey(hashKeyName, hashKeyValue));
        return this;
    }
1274815
private Map<String, Criteria> getCriterias(Map<String, String[]> params) {
        Map<String, Criteria> result = new HashMap<String, Criteria>();
        for (Map.Entry<String, String[]> param : params.entrySet()) {
            for (Criteria criteria : FILTER_CRITERIAS) {
                if (criteria.getName().equals(param.getKey())) {
                    try {
                        Criteria[] parsedCriterias = criteria.parseValue(param.getValue()[0]);
                        for (Criteria parsedCriteria : parsedCriterias) {
                            result.put(parsedCriteria.getName(), parsedCriteria);
                        }
                    } catch (Exception e) {
                        // Exception happened during paring
                        LOG.log(Level.SEVERE, "Error parsing parameter " + param.getKey(), e);
                    }
                    break;
                }
            }
        }
        return result;
    }
561597
int[] getKeys()
    {
        Set<Integer> keySet = map.keySet();
        int keys[] = new int[keySet.size()];
        int index = 0;
        for (Integer key : keySet)
        {
            keys[index] = key;
            index++;
        }
        return keys;
    }
831744
@SuppressWarnings("unchecked")
	public <T> Map<Serializable, T> get(Collection<? extends Serializable> keys) {
		Map<Serializable, T> result = Maps.newHashMapWithExpectedSize(keys.size());
		for (Serializable key : keys) {
			T value = (T) contents.getIfPresent(key);
			if (value != null) {
				result.put(key, value);
			}
		}
		if (log.isDebugEnabled() && !result.isEmpty()) {
			log.debug("Level 1 cache multiple hit: {}", result.keySet());
		}
		return result;
	}
722930
@Override
  public List<ApiType> byIndex(String indexName, String indexKey) {
    lock.lock();
    try {
      if (!this.indexers.containsKey(indexName)) {
        throw new IllegalArgumentException(String.format("index %s doesn't exist!", indexName));
      }
      Map<String, Set<String>> index = this.indices.get(indexName);
      Set<String> set = index.get(indexKey);
      if (set == null) {
        return Arrays.asList();
      }
      List<ApiType> items = new ArrayList<>(set.size());
      for (String key : set) {
        items.add(this.items.get(key));
      }
      return items;
    } finally {
      lock.unlock();
    }
  }
465478
public TableKeysAndAttributes addPrimaryKey(PrimaryKey primaryKey) {
        if (primaryKey != null) {
            if (primaryKeys == null)
                primaryKeys = new ArrayList<PrimaryKey>();
            checkConsistency(primaryKey);
            this.primaryKeys.add(primaryKey);
        }
        return this;
    }
250772
@Override
    public <K, M extends Map<K, ?>> Expression<Set<K>> keys(M arg0)
    {
        // TODO Auto-generated method stub
        return null;
    }