blob: d7bcd6d9bc07a05a5acd3f0d1113837398d51144 [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.annotation.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) {
}
}
}