aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/resources/com/google/googlejavaformat/java/testimports/A.formatting-only
blob: 7d5df53cb6a62f0fd14385745f6dc8459b4fab80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.google.example;

import com.google.common.base.Preconditions;

import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.util.List;

import javax.annotations.Nullable;

import static org.junit.Assert.fail;
import static com.google.truth.Truth.assertThat;

@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) {
    }
  }
}