All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hamcrest.internal.NullSafety Maven / Gradle / Ivy

There is a newer version: 3.0
Show newest version
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[] itemMatchers) {
        final List> matchers = new ArrayList>(itemMatchers.length);
        for (final Matcher itemMatcher : itemMatchers) {
            matchers.add((Matcher) (itemMatcher == null ? IsNull.nullValue() : itemMatcher));
        }
        return matchers;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy