public static DisruptContext error(long latency)
  {
    if (latency < 0)
    {
      throw new IllegalArgumentException("Latency cannot be smaller than 0");
    }
    return new ErrorDisruptContext(latency);
  }
@Test
  public void testError()
  {
    final long latency = 4200;
    DisruptContexts.ErrorDisruptContext context =
        (DisruptContexts.ErrorDisruptContext) DisruptContexts.error(latency);

    Assert.assertEquals(context.mode(), DisruptMode.ERROR);
    Assert.assertEquals(context.latency(), latency);
  }