@Test
public void testListElected() {

  // given
  final AccountOperation mockOperation = mock(AccountOperation.class);
  when(mockOperation.listElected(anyString(), anyInt()))
      .thenReturn(Collections.<ElectedCandidate>emptyList());
  final AergoClient mockClient = mock(AergoClient.class);
  when(mockClient.getAccountOperation()).thenReturn(mockOperation);
  final ClientProvider mockClientProvider = mock(ClientProvider.class);
  when(mockClientProvider.getClient()).thenReturn(mockClient);
  // then
  final QueryApi queryApi = new QueryApiImpl(mockClientProvider);
  final List<ElectedCandidate> electedCandidates = queryApi.listElected(anyVoteId, anySize);
  assertNotNull(electedCandidates);
}