@Test
  public void testCloseShouldRetryOnceOnInterruptedException() {
    ZkClient zkClient = mock(ZkClient.class);
    ZkUtils zkUtils = new ZkUtils(KEY_BUILDER, zkClient, CONNECTION_TIMEOUT_MS, SESSION_TIMEOUT_MS, new NoOpMetricsRegistry());

    Mockito.doThrow(new ZkInterruptedException(new InterruptedException()))
           .doAnswer(invocation -> null)
           .when(zkClient).close();

    zkUtils.close();

    Mockito.verify(zkClient, Mockito.times(2)).close();
  }
Create two duplicate processors with same processorId.
Second creation should fail with exception.
samza-core/src/test/java/org/apache/samza/zk/TestZkUtils.java