@Test public void castContract() { ArrayList al = new ArrayList(); al.add((Object) ""); Iterable<String> s = Linqy.<String>cast(al); Assert.assertTrue(s.iterator().next() instanceof String); }
public static <E> Iterable<E> cast(final Iterable i) { return map(i, new Mapper<Object, E>() { public E apply(Object o) { return (E) o; } }); }
Linqy { public static <E> Iterable<E> cast(final Iterable i) { return map(i, new Mapper<Object, E>() { public E apply(Object o) { return (E) o; } }); } }
Linqy { public static <E> Iterable<E> cast(final Iterable i) { return map(i, new Mapper<Object, E>() { public E apply(Object o) { return (E) o; } }); } private  Linqy(); }
Linqy { public static <E> Iterable<E> cast(final Iterable i) { return map(i, new Mapper<Object, E>() { public E apply(Object o) { return (E) o; } }); } private  Linqy(); static List<E> asList(Iterable<E> i); static Iterable<E> cast(final Iterable i); static Iterable<E> singleton(final E single); static Iterable<T> map(final Iterable<F> from,
                                         final Mapper<? super F, T> mapper); static Iterable<T> filter(final Iterable<T> sequence,
                                         final Predicate<? super T> filter); static int count(Iterable seq); static boolean any(final Iterable<T> sequence,
                                  final Predicate<? super T> predicate); static boolean all(final Iterable<T> sequence,
                                  final Predicate<? super T> predicate); }
Linqy { public static <E> Iterable<E> cast(final Iterable i) { return map(i, new Mapper<Object, E>() { public E apply(Object o) { return (E) o; } }); } private  Linqy(); static List<E> asList(Iterable<E> i); static Iterable<E> cast(final Iterable i); static Iterable<E> singleton(final E single); static Iterable<T> map(final Iterable<F> from,
                                         final Mapper<? super F, T> mapper); static Iterable<T> filter(final Iterable<T> sequence,
                                         final Predicate<? super T> filter); static int count(Iterable seq); static boolean any(final Iterable<T> sequence,
                                  final Predicate<? super T> predicate); static boolean all(final Iterable<T> sequence,
                                  final Predicate<? super T> predicate);  }