/** * And the the left and right filters. */ public AndFilter(Filter left, Filter right) { this(CollectionUtil.newList(left, right)); }
/** * Takes the result of the left and right filter and ORs them. */ public OrFilter(final Filter left, final Filter right) { this(CollectionUtil.newList(left, right)); }
/** * And the the left and right filters. */ public AndFilter(Filter left, Filter right) { this(CollectionUtil.newList(left, right)); }
/** * Takes the result of the left and right filter and ORs them. */ public OrFilter(final Filter left, final Filter right) { this(CollectionUtil.newList(left, right)); }
/** * Create a modifiable sorted {@link List} based on the {@link Collection} * provided. */ public static <T extends Object & Comparable<? super T>> List<T> newSortedList( final Collection<? extends T> col) { List<T> list = newList(col); Collections.sort(list); return list; }
/** * Create a modifiable sorted {@link List} based on the {@link Collection} * provided. */ public static <T extends Object & Comparable<? super T>> List<T> newSortedList( final Collection<? extends T> col) { List<T> list = newList(col); Collections.sort(list); return list; }
/** * Creates an unmodifiable {@link List} from a collection. */ public static <T> List<T> newReadOnlyList(final Collection<? extends T> c) { return Collections.unmodifiableList(newList(c)); }
/** * Creates an unmodifiable {@link List} from a collection. */ public static <T> List<T> newReadOnlyList(final Collection<? extends T> c) { return Collections.unmodifiableList(newList(c)); }
/** * Create a modifiable sorted {@link List} based on the {@link Collection} * provided. */ public static <T extends Object & Comparable<? super T>> List<T> newSortedList( final Collection<? extends T> col) { List<T> list = newList(col); Collections.sort(list); return list; }
/** * Creates an unmodifiable {@link List} from a collection. */ public static <T> List<T> newReadOnlyList(final Collection<? extends T> c) { return Collections.unmodifiableList(newList(c)); }
/** * Creates an unmodifiable {@link List} from a variable number arguments. */ public static <T> List<T> newReadOnlyList(T... obj) { return Collections.unmodifiableList(newList(obj)); }
/** * Creates an unmodifiable {@link List} from a variable number arguments. */ @SafeVarargs public static <T> List<T> newReadOnlyList(T... obj) { return Collections.unmodifiableList(newList(obj)); }
/** * Creates an unmodifiable {@link List} from a variable number arguments. */ @SafeVarargs public static <T> List<T> newReadOnlyList(T... obj) { return Collections.unmodifiableList(newList(obj)); }
static <E> boolean checkValue(List<E> fetchedValues, List<E> expectedValues) { Iterator<E> e = expectedValues.iterator(); List<E> fetchedValuesClone = CollectionUtil.newList(fetchedValues); while (e.hasNext()) { E expected = e.next(); boolean found = false; Iterator<E> f = fetchedValuesClone.iterator(); while (f.hasNext()) { if (CollectionUtil.equals(expected, f.next())) { f.remove(); found = true; break; } } if (!found) { return false; } } return true; }
static <E> boolean checkValue(List<E> fetchedValues, List<E> expectedValues) { Iterator<E> e = expectedValues.iterator(); List<E> fetchedValuesClone = CollectionUtil.newList(fetchedValues); while (e.hasNext()) { E expected = e.next(); boolean found = false; Iterator<E> f = fetchedValuesClone.iterator(); while (f.hasNext()) { if (CollectionUtil.equals(expected, f.next())) { f.remove(); found = true; break; } } if (!found) { return false; } } return true; }
static <E> boolean checkValue(List<E> fetchedValues, List<E> expectedValues) { Iterator<E> e = expectedValues.iterator(); List<E> fetchedValuesClone = CollectionUtil.newList(fetchedValues); while (e.hasNext()) { E expected = e.next(); boolean found = false; Iterator<E> f = fetchedValuesClone.iterator(); while (f.hasNext()) { if (CollectionUtil.equals(expected, f.next())) { f.remove(); found = true; break; } } if (!found) { return false; } } return true; }
@Test public void testAsList() { Collection<Integer> c = new HashSet<>(); c.add(1); c.add(2); List<Integer> list = CollectionUtil.newList(c); assertTrue(list.remove(Integer.valueOf(1))); assertTrue(list.remove(Integer.valueOf(2))); // make sure it can be modified.. list.add(2); // make sure asset can handle null.. c = null; CollectionUtil.newList(c); // test array.. list = CollectionUtil.newList(1, 2); assertTrue(list.remove(Integer.valueOf(1))); assertTrue(list.remove(Integer.valueOf(2))); }
List<Object> simpleMarshallArgs = CollectionUtil.newList(args); ObjectStreamHandler streamHandlerArg = extractStreamHandler(method.getParameterTypes(), simpleMarshallArgs);
List<Object> simpleMarshallArgs = CollectionUtil.newList(args); ObjectStreamHandler streamHandlerArg = extractStreamHandler(method.getParameterTypes(), simpleMarshallArgs);