MessageListenerThread extends Thread { double longProcessThreshold(double batchLongProcessThreshold, int recordCount, int totalCount) { return batchLongProcessThreshold * recordCount / totalCount; } MessageListenerThread(String name, MessageListener listener); @Override void run();  }
@Test void longProcessThreshold() { assertThat(thread.longProcessThreshold(Duration.ofNanos(500).toNanos(), 1, 100)).isEqualTo(5); assertThat(thread.longProcessThreshold(Duration.ofNanos(500).toNanos(), 1, 1)).isEqualTo(500); }