您可以使用
IsNull.nullValue()方法:
import static org.hamcrest.Matchers.is;import static org.hamcrest.Matchers.nullValue;assertThat(attr.getValue(), is(nullValue()));

您可以使用
IsNull.nullValue()方法:
import static org.hamcrest.Matchers.is;import static org.hamcrest.Matchers.nullValue;assertThat(attr.getValue(), is(nullValue()));