package org.psjava.util;

import java.util.Iterator;

public class FilteredIterable {

	public static <T> Iterable<T> create(final Iterable<? extends T> original, final Filter<T> filter) {
		return new Iterable<T>() {
			@Override
			public Iterator<T> iterator() {
				return FilteredIterator.create(original.iterator(), filter);
			}
		};
	}

	private FilteredIterable() {
	}

}
@@ -80,17 +80,20 @@
 able %7B%0A%0A
-%09
+    
 public s
@@ -189,89 +189,166 @@
 ) %7B%0A
-%09%09return new Iterable%3CT%3E() %7B%0A%09%09%09@Override%0A%09%09%09public Iterator%3CT%3E iterator() %7B%0A%09%09%09%09
+        return IterableUsingIteratorFactory.create(new IteratorFactory%3CT%3E() %7B%0A            @Override%0A            public Iterator%3CT%3E create() %7B%0A                
 retu
@@ -408,23 +408,45 @@
 r);%0A
-%09%09%09%7D%0A%09%09%7D;%0A%09%7D%0A%0A%09
+            %7D%0A        %7D);%0A    %7D%0A%0A    
 priv
@@ -474,9 +474,12 @@
 ) %7B%0A
-%09
+    
 %7D%0A%0A%7D

improve one toString for debugging