@Test
  public void testScheduledChoreConstruction() {
    final String NAME = "chore";
    final int PERIOD = 100;
    final long VALID_DELAY = 0;
    final long INVALID_DELAY = -100;
    final TimeUnit UNIT = TimeUnit.NANOSECONDS;

    ScheduledChore chore1 =
      new ScheduledChore(NAME, new SampleStopper(), PERIOD, VALID_DELAY, UNIT) {
        @Override
        protected void chore() {
          // DO NOTHING
        }
      };

    assertEquals("Name construction failed", NAME, chore1.getName());
    assertEquals("Period construction failed", PERIOD, chore1.getPeriod());
    assertEquals("Initial Delay construction failed", VALID_DELAY, chore1.getInitialDelay());
    assertEquals("TimeUnit construction failed", UNIT, chore1.getTimeUnit());

    ScheduledChore invalidDelayChore =
      new ScheduledChore(NAME, new SampleStopper(), PERIOD, INVALID_DELAY, UNIT) {
        @Override
        protected void chore() {
          // DO NOTHING
        }
      };

    assertEquals("Initial Delay should be set to 0 when invalid", 0,
      invalidDelayChore.getInitialDelay());
  }
@param failThreshold Number of times the Chore fails when trying to execute initialChore
                     before succeeding.
hbase-common/src/test/java/org/apache/hadoop/hbase/TestChoreService.java