### Question:
AbstractNiFiConnectionsRestClient implements NiFiConnectionsRestClient { protected DropRequestDTO deleteQueueWithRetries(@Nonnull final String processGroupId, @Nonnull final String connectionId, final int retries, final int timeout, @Nonnull final TimeUnit timeUnit) { DropRequestDTO dropRequest = createDropRequest(processGroupId, connectionId); for (int count = 0; !dropRequest.isFinished() && count < retries; ++count) { Uninterruptibles.sleepUninterruptibly(timeout, timeUnit); dropRequest = getDropRequest(processGroupId, connectionId, dropRequest.getId()) .orElseThrow(() -> new NifiComponentNotFoundException(connectionId, NifiConstants.NIFI_COMPONENT_TYPE.CONNECTION, null)); } if (!dropRequest.isFinished()) { throw new NifiClientRuntimeException("Timeout waiting for queue to delete for connection: " + connectionId); } return deleteDropRequest(processGroupId, connectionId, dropRequest.getId()) .orElseThrow(() -> new NifiComponentNotFoundException(connectionId, NifiConstants.NIFI_COMPONENT_TYPE.CONNECTION, null)); }  @Override boolean deleteQueue(@Nonnull final String processGroupId, @Nonnull final String connectionId);  }### Answer:
@Test public void deleteQueueWithRetries() { final DropRequestDTO request1 = new DropRequestDTO(); request1.setId("33d0b0c1-88b4-4c75-b61a-83223df79d8c"); request1.setFinished(false); final DropRequestDTO request2 = new DropRequestDTO(); request2.setId("33d0b0c1-88b4-4c75-b61a-83223df79d8c"); request2.setFinished(true); final AbstractNiFiConnectionsRestClient client = Mockito.mock(AbstractNiFiConnectionsRestClient.class, Mockito.CALLS_REAL_METHODS); Mockito.when(client.createDropRequest("group", "connection")).thenReturn(request1); Mockito.when(client.getDropRequest("group", "connection", request1.getId())).thenReturn(Optional.of(request2)); Mockito.when(client.deleteDropRequest("group", "connection", request1.getId())).thenReturn(Optional.of(request2)); Assert.assertEquals(request2, client.deleteQueueWithRetries("group", "connection", 1, 0, TimeUnit.NANOSECONDS)); }