import static java.util.regex.Pattern.CASE_INSENSITIVE;
import static java.util.regex.Pattern.UNICODE_CASE;
import static java.util.regex.Pattern.compile;
+import static java.util.stream.Collectors.toList;
import java.io.IOException;
import java.io.Writer;
@Override
public State execute(State state, List<String> parameters, Writer outputWriter) throws IOException {
List<Result> lastResult = newArrayList();
+ List<SearchParameter> searchParameters = parameters.stream().map(SearchParameter::from).collect(toList());
for (Bot bot : newArrayList(core.bots())) {
for (Pack pack : newArrayList(bot)) {
- if (parameters.stream().map(SearchParameter::from).allMatch((parameter) -> parameter.matches(pack.name()))) {
+ if (searchParameters.stream().allMatch((parameter) -> parameter.matches(pack.name()))) {
lastResult.add(new Result(core, bot, pack));
}
}