Takes a map of value to labels and the unique name of the list
@param items map of value to labels
@return a Builder instance to allow chaining
542184
public FacetBuilder setItemsList(Map<String, String> items) {
        ArrayList<FacetWidgetItem> facetWidgetItems = new ArrayList<FacetWidgetItem>();

        for (String key : items.keySet()){
            String label = items.get(key);
            FacetWidgetItem facetWidgetItem = new FacetWidgetItem(key, label);
            facetWidgetItems.add(facetWidgetItem);
        }
        this.listItems = facetWidgetItems;
        return this;
    }
892250
public int add(T item) {
		
		Integer count = map.get(item);
		
		if(count == null) {
			map.put(item, 1);
			return 1;
		} else {
			map.put(item, count + 1);
			return count + 1;
		}
	}
1146033
public static <T extends Comparable<T>> List<T> sorted(Iterable<T> items) {
    List<T> result = toList(items);
    Collections.sort(result);
    return result;
  }
101616
public static <T> T first(List<T> items) {
        if(items != null && items.size() > 0) {
            return items.get(0);
        }

        return null;
    }
845925
public static <T> Iterable<PSArray<T>> create(Iterable<T> items, final Comparator<T> comparator) {
        MutableArray<T> initial = MutableArrayFromIterable.create(items);
        GoodSortingAlgorithm.getInstance().sort(initial, comparator);
        return IterableUsingStatusUpdater.create(initial, new Updater<PSArray<T>>() {
            @Override
            public PSArray<T> getUpdatedOrNull(PSArray<T> current) {
                MutableArray<T> next = MutableArrayFromIterable.create(current);
                boolean success = NextPermutation.step(next, comparator);
                return success ? next : null;
            }
        });
    }
429333
public void setItems(java.util.Collection<ApiMapping> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<ApiMapping>(items);
    }
329313
public ModelAdapter<?, Item> add(List<Item> items) {
        if (mOriginalItems != null && items.size() > 0) {
            if (mItemAdapter.isUseIdDistributor()) {
                mItemAdapter.getIdDistributor().checkIds(items);
            }
            mOriginalItems.addAll(items);
            publishResults(mConstraint, performFiltering(mConstraint));
            return mItemAdapter;
        } else {
            return mItemAdapter.addInternal(items);
        }
    }
1173808
public void mapPossibleTypes(@Nullable Iterable<Item> items) {
        if (items != null && mFastAdapter != null) {
            for (Item item : items) {
                mFastAdapter.registerTypeInstance(item);
            }
        }
    }
280309
public static <T> Matcher<Iterable<T>> hasItems(Iterable<T> items) {
        List<Matcher<? super Iterable<T>>> all = new LinkedList<Matcher<? super Iterable<T>>>();
        for (T element : items) {
            all.add(hasItem(element));
        }

        return allOf(all);
    }
616509
public static Expression asImmutableList(Iterable<? extends Expression> items) {
    ImmutableList<Expression> copy = ImmutableList.copyOf(items);
    if (copy.size() < MethodRef.IMMUTABLE_LIST_OF.size()) {
      return MethodRef.IMMUTABLE_LIST_OF.get(copy.size()).invoke(copy);
    }
    ImmutableList<Expression> explicit = copy.subList(0, MethodRef.IMMUTABLE_LIST_OF.size());
    Expression remainder =
        asArray(OBJECT_ARRAY_TYPE, copy.subList(MethodRef.IMMUTABLE_LIST_OF.size(), copy.size()));
    return MethodRef.IMMUTABLE_LIST_OF_ARRAY.invoke(
        Iterables.concat(explicit, ImmutableList.of(remainder)));
  }
721631
@SuppressWarnings("unchecked")
    @NonNull
    public static Set<String> nonNullSet(@Nullable String[] items) {
        return items == null || items.length == 0
                ? Collections.<String>emptySet()
                : new HashSet<String>(asList(items));
    }
135785
public void setItems(java.util.Collection<BasePathMapping> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<BasePathMapping>(items);
    }
988300
public void setItems(Map<String, String> items) {

        clearItems();
        m_items = items;
        for (Map.Entry<String, String> entry : items.entrySet()) {
            addOption(entry.getKey(), entry.getValue());
        }
    }
744077
public ModelAdapter<Model, Item> set(List<Model> items) {
        return set(items, true);
    }
319405
def serialize(self, items):
        
        r = StringIO()
        for key, value in items.items():
            if isinstance(value, list):
                # handle special case of lists
                value = "["+", ".join(map(str, value))+"]"
            r.write("%s = %s\n" % (key, value))
        return r.getvalue()
983832
public static String formatAllLabels(Node node, Map<String, Set<String>> uniqueConstraints, Set<String> indexNames) {
        StringBuilder result = new StringBuilder(100);
        boolean uniqueLabelFound = false;
        List<String> list = getLabelsSorted(node);

        for (String labelName : list) {
            uniqueLabelFound = isUniqueLabelFound(node, uniqueConstraints, labelName);
            if (indexNames != null && indexNames.contains(labelName))
                result.insert(0, label(labelName));
            else
                result.append(label(labelName));
        }
        if (!uniqueLabelFound) {
            result.append(label(UNIQUE_ID_LABEL));
        }
        return result.toString();
    }
871951
public void setItems(java.util.Collection<Item> items) {
        if (items == null) {
            this.items = null;
            return;
        }

        this.items = new java.util.ArrayList<Item>(items);
    }