public static <T> Iterable<T> filter(Iterable<? extends T> c, Predicate<? super T> p) {
		List<T> result = new ArrayList<T>();

		for (T e : c) {
			if (p.apply(e)) {
				result.add(e);
			}
		}

		return result;
	}