![JAR search and dependency download from the Maven repository](/logo.png)
autofixture.implementationdetails.CollectionFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of autofixturegenerator Show documentation
Show all versions of autofixturegenerator Show documentation
An attempt to reimplement core features of a popular .NET anonymous value generator - AutoFixture - in
Java
package autofixture.implementationdetails;
import com.google.common.reflect.TypeToken;
import java.lang.reflect.Array;
import java.util.*;
import java.util.concurrent.*;
/**
* Created by astral on 07.02.15.
*/
public class CollectionFactory {
public static Map createMapFrom(final T[] keys, final V[] values) {
final Map map = new HashMap<>();
for (int i = 0; i < keys.length; ++i) {
map.put(keys[i], values[i]);
}
return map;
}
public static Deque createDequeFrom(final Collection many) {
return new ArrayDeque<>(many);
}
public static SortedSet createSortedSetFrom(final Collection many) {
return new TreeSet<>(many);
}
public static Set createSetFrom(final Collection many) {
return new HashSet<>(many);
}
public static SortedMap createSortedMapFrom(final Map map) {
return new TreeMap<>(map);
}
public static List createList() {
return new ArrayList<>();
}
public static ArrayList
© 2015 - 2025 Weber Informatics LLC | Privacy Policy