
com.github.tomakehurst.wiremock.common.ListFunctions Maven / Gradle / Ivy
package com.github.tomakehurst.wiremock.common;
import java.util.ArrayList;
import java.util.List;
public final class ListFunctions {
public static Pair, List> splitByType(A[] items, Class subType) {
List as = new ArrayList<>();
List bs = new ArrayList<>();
for (A a : items) {
if (subType.isAssignableFrom(a.getClass())) {
bs.add((B) a);
} else {
as.add(a);
}
}
return new Pair<>(as, bs);
}
private ListFunctions() {
throw new UnsupportedOperationException("Not instantiable");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy