blob: 88f83f18782893a668084c2d44aed661faf4add9 [file] [log] [blame]
package com.google.example;
import static com.google.truth.Truth.assertThat;
import static org.junit.Assert.fail;
import com.google.common.base.Preconditions;
import java.util.List;
import javax.annotations.Nullable;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
@RunWith( JUnit4.class ) public class SomeTest {
<T> void check(@Nullable List<T> x) {
Preconditions.checkNodeNull(x);
}
void f() {
List<String> xs = null;
assertThat(xs).isNull();
try {
check(xs);
fail();
} catch (NullPointerException e) {
}
}
}