public static long elapsed(long started, long finished) {
    return Times.elapsed(started, finished, true);
  }
@Test
  void testFinishTimesAheadOfStartTimes() {
    long elapsed = Times.elapsed(10, 5, true);
    assertEquals(-1, elapsed, "Elapsed time is not -1");
    elapsed = Times.elapsed(10, 5, false);
    assertEquals(-1, elapsed, "Elapsed time is not -1");
    // use Long.MAX_VALUE to ensure started time is after the current one
    elapsed = Times.elapsed(Long.MAX_VALUE, 0, true);
    assertEquals(-1, elapsed, "Elapsed time is not -1");
  }