org.hamcrest.internal.NullSafety Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hamcrest Show documentation
Show all versions of hamcrest Show documentation
Core API and libraries of hamcrest matcher framework.
package org.hamcrest.internal;
import org.hamcrest.Matcher;
import org.hamcrest.core.IsNull;
import java.util.ArrayList;
import java.util.List;
public class NullSafety {
@SuppressWarnings("unchecked")
public static List> nullSafe(Matcher super E>[] itemMatchers) {
final List> matchers = new ArrayList>(itemMatchers.length);
for (final Matcher super E> itemMatcher : itemMatchers) {
matchers.add((Matcher super E>) (itemMatcher == null ? IsNull.nullValue() : itemMatcher));
}
return matchers;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy