public void test_plusNanos_halfABillion() {

    LocalDateTime t = this.TEST_2007_07_15_12_30_40_987654321.with(LocalTime.MIDNIGHT);
    LocalDate d = t.getDate();

    int hour = 0;
    int min = 0;
    int sec = 0;
    int nanos = 0;

    for (long i = 0; i < 3700 * 1000000000L; i += 500000000) {
      t = t.plusNanos(500000000);
      nanos += 500000000;
      if (nanos == 1000000000) {
        sec++;
        nanos = 0;
      }
      if (sec == 60) {
        min++;
        sec = 0;
      }
      if (min == 60) {
        hour++;
        min = 0;
      }

      assertEquals(t.getDate(), d, String.valueOf(i));
      assertEquals(t.getHour(), hour);
      assertEquals(t.getMinute(), min);
      assertEquals(t.getSecond(), sec);
      assertEquals(t.getNano(), nanos);
    }
  }