Creates a new Set.

@param providers
vararg array of providers
@return set containing providers
357680
private static Set<InjectionProvider<?>> newProviderSet(final InjectionProvider<?>... providers) {
        final Set<InjectionProvider<?>> result = new LinkedHashSet<InjectionProvider<?>>();

        if (providers != null && providers.length > 0) {

            for (final InjectionProvider<?> provider : providers) {
                result.add(provider);
            }

        }
        return result;
    }
946987
public static ArrayList<String> toList( Set<String> set )
	{
		int n = set.size();
		ArrayList<String> list = new ArrayList<String>( n );
		for (String string : set)
		{
			list.add(string);
		}
		return list;
	}
1352467
public static InjectionProvider<?>[] providersForInstancesSuppliers(final InjectionProviderInstancesSupplier... suppliers) {
        final InjectionProviderInstancesSupplier supplier = mergeSuppliers(suppliers);
        return supplier.get().toArray(new InjectionProvider<?>[supplier.get().size()]);
    }
529480
public static <A> Set<A> set(A... elements) {
        final Set<A> set = new HashSet<A>(elements.length);
        for (A element : elements) {
            set.add(element);
        }
        return set;
    }
154812
public static Set<Map<String, Object>> setify(ObjectMapper mapper, Object source) {
        return (Set<Map<String, Object>>) collectify(mapper, source, Set.class);
    }
940962
@SafeVarargs
   public static <T> Set<T> makeSet(T... entries) {
      return new HashSet<>(Arrays.asList(entries));
   }
1204350
@SuppressWarnings(
	{ "unchecked" })
	public static <T> Set<T> toSet(T...args)
	{
		if(args == null || args.length ==0)
			return null;
		
		HashSet<T> set = new HashSet<>(args.length);
		
		fill(set,args);
		return set;
	}
891916
@Override
  public <T> Provider<T> provider(Key<T> key)
  {
    Objects.requireNonNull(key);

    Provider<T> provider = (Provider) _providerMap.get(key);

    if (provider == null) {
      provider = lookupProvider(key);

      if (provider == null) {
        provider = autoProvider(key);
      }

      _providerMap.putIfAbsent(key, provider);

      provider = (Provider) _providerMap.get(key);
    }

    return provider;
  }
49205
public static ProviderContextBuilder of(String provider, Collection<RateType> rateTypes) {
        return new ProviderContextBuilder(provider, rateTypes);
    }
575766
public static <T> Set<T> wrap(final Set<T> source) {
        val list = new LinkedHashSet<T>();
        if (source != null && !source.isEmpty()) {
            list.addAll(source);
        }
        return list;
    }
1180476
public static <T> Set<T> union(Collection<Set<T>> sets) {
		Set<T> result = new HashSet<>();
		if (sets.isEmpty()) {
			return result;
		}
		Iterator<Set<T>> iter = sets.iterator();
		result.addAll(iter.next());

		if (sets.size() == 1) {
			return result;
		}

		while (iter.hasNext()) {
			result.addAll(iter.next());
		}
		return result;
	}
577925
private <T> Provider<T> createProvider(Key<T> key)
  {
    Class<T> type = (Class<T>) key.rawClass();

    if (Provider.class.equals(type)) {
      TypeRef subType = TypeRef.of(key.type()).to(Provider.class).param(0);

      Key<Object> subkey = Key.of(subType.type(), key.annotationTypes());

      return (Provider) new ProviderProvider(key, -10, provider(subkey));
    }
    else if (Optional.class.equals(type)) {
      TypeRef subType = TypeRef.of(key.type()).to(Optional.class).param(0);

      Key<Object> subkey = Key.of(subType.type(), key.annotationTypes());

      return (Provider) new ProviderOptional(key, -10, provider(subkey));
    }
    else if (type.isInterface() || Modifier.isAbstract(type.getModifiers())) {
      return new ProviderNull(key, -10000, new InjectScopeSingleton());
    }

    int priority = -10;

    // auto-provider is factory
    InjectScope<T> scope = findScope(type);

    BindingAmp<T> binding = new ProviderConstructor<>(this, key, priority, scope, type);

    binding.bind();

    return binding.provider();
  }
672472
public <T> RestBuilder addProvider(Class<T> clazz, Class<? extends ContextProvider<T>> provider) {

		Assert.notNull(clazz, "Missing provided class type!");
		Assert.notNull(provider, "Missing context provider!");
		registeredProviders.put(clazz, provider);
		return this;
	}
1035770
public static <T> Set<T> asSet(T... items) {
        Set<T> set = new HashSet<T>();
        for (T item : items) {
            set.add(item);
        }
        return set;
    }
855973
public static <X> ChainedProviderService<X> chain(final String name,
                                                      final List<ProviderService<X>> services) {

        return new ChainedProviderServiceImpl<X>(name, services);
    }
124290
public CreateCollectionRequestBuilder<T,ID> create(List<T> items)
    {
        return new CreateCollectionRequestBuilder<T,ID>(version,type,entityName,items);
    }
591623
public static <T> ArrayList<T> newArrayList(Collection<T> collection) {
		return (ArrayList<T>) list(false, collection);
	}