testdata for IDEA-20244

This commit is contained in:
anna
2013-05-03 13:30:11 +02:00
parent 065d7d8c51
commit 11eae151b7
2 changed files with 24 additions and 0 deletions
@@ -0,0 +1,23 @@
import java.util.Collection;
class Test {
public static final UnaryFunction<Object, Object, RuntimeException> unaryFunction = new UnaryFunction<Object, Object, RuntimeException>() {
public Object execute(Object o) throws RuntimeException {
return null;
}
};
public static <A, B, X extends Throwable> void someMethod() {
transformCollection(null, unaryFunction, null);
}
public static <A, B, X extends Throwable> void transformCollection(Collection<? extends A> input, UnaryFunction<A, B, X> transform, Collection<? super B> output) throws X {
for (A a : input) {
B b = transform.execute(a);
output.add(b);
}
}
}
interface UnaryFunction<A, B, X extends Throwable> {
public B execute(A a) throws X;
}