junitparams.internal.parameters.toarray.IteratorResultToArray Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of JUnitParams Show documentation
Show all versions of JUnitParams Show documentation
Better parameterised tests for JUnit
package junitparams.internal.parameters.toarray;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
class IteratorResultToArray implements ResultToArray {
private Object result;
IteratorResultToArray(Object result) {
this.result = result;
}
@Override
public boolean isApplicable() {
return Iterator.class.isAssignableFrom(result.getClass());
}
@Override
public Object[] convert() {
Object iteratedElement = null;
try {
List