@Test
@PrepareForTest(AergoClientBuilder.class)
@SuppressWarnings("unchecked")
public void testReturnResource() throws Exception {

  // Given
  final ConnectStrategy<ManagedChannel> connectStrategy = mock(ConnectStrategy.class);
  final AergoClient client = mock(AergoClient.class);
  whenNew(AergoClient.class).withAnyArguments().thenReturn(client);
  // When
  final AergoPool pool = new AergoPool(randomUUID().toString());
  final AergoApi api = pool.borrowResource();
  pool.returnResource(api);
  // Then
  verify((AergoClient) api).close();
}