public void test_compareTo() {

    for (int i = -4; i <= 2104; i++) {
      Year a = Year.of(i);
      for (int j = -4; j <= 2104; j++) {
        Year b = Year.of(j);
        if (i < j) {
          assertEquals(a.compareTo(b) < 0, true);
          assertEquals(b.compareTo(a) > 0, true);
          assertEquals(a.isAfter(b), false);
          assertEquals(a.isBefore(b), true);
          assertEquals(b.isAfter(a), true);
          assertEquals(b.isBefore(a), false);
        } else if (i > j) {
          assertEquals(a.compareTo(b) > 0, true);
          assertEquals(b.compareTo(a) < 0, true);
          assertEquals(a.isAfter(b), true);
          assertEquals(a.isBefore(b), false);
          assertEquals(b.isAfter(a), false);
          assertEquals(b.isBefore(a), true);
        } else {
          assertEquals(a.compareTo(b), 0);
          assertEquals(b.compareTo(a), 0);
          assertEquals(a.isAfter(b), false);
          assertEquals(a.isBefore(b), false);
          assertEquals(b.isAfter(a), false);
          assertEquals(b.isBefore(a), false);
        }
      }
    }
  }

  @Test(expectedExceptions = NullPointerException.class, groups = { "tck" }