### Question:
Delay implements TransactionParticipant, Configurable { void sleep (long delay) { if (delay > 0L) { try { Thread.sleep (random != null ? (long)random.nextDouble()*delay : delay); } catch (InterruptedException ignored) { } } }  int prepare(long id, Serializable context); void commit(long id, Serializable context); void abort(long id, Serializable context); void setConfiguration(Configuration cfg);  }### Answer:
@Test public void testComputeDelay() { delay.sleep(5L); verify(random, atLeastOnce()).nextDouble(); }