@Test(timeout = 2000)
  public void testBlacklist() throws ServiceException {
    Map<String, LlapMetrics> data = generateClusterMetrics();
    listener.newClusterMetrics(data);

    // Then
    ArgumentCaptor<String> argumentCaptor = ArgumentCaptor.forClass(String.class);

    verify(mockClient, times(1)).setCapacity(any(), any(SetCapacityRequestProto.class));
    verify(mockInstanceSet, times(1)).getInstance(argumentCaptor.capture());
    assertEquals("3", argumentCaptor.getValue());
  }
Test class to test BlacklistingLlapMetricsListener object.
llap-tez/src/test/org/apache/hadoop/hive/llap/tezplugins/metrics/TestBlacklistingLlapMetricsListener.java