@SuppressWarnings("ConstantConditions") static <T, V> Collection<V> genericCollect( Collection<T> from, Class<? extends Collection> collectionClass, int initialCapacity) { checkPrepositions(J7GroupPrepositions.Preposition.FIELD); Collection<V> collected = createCollectionInstance(collectionClass, initialCapacity); for (T entity : from) { collected.add(ProxyHelper.<V>extractFirstArgument(entity)); } return collected; }
private static boolean extractDesiredValue() { J7GroupPrepositions.Preposition calledPreposition = ProxyHelper.getCalledPreposition(FIRST_PREPOSITION_INDEX); try { switch (calledPreposition) { case WHEN_TRUE: return true; case WHEN_FALSE: return false; default: throw new IllegalPrepositionException( "Not allowed preposition was used. " + "Expected prepositions: WHEN_TRUE, WHEN_FALSE. Actual preposition: " + calledPreposition); } } finally { clearCalledPrepositions(); } }