### Question:
CassandraArchiveRepository implements ArchiveRepository { protected Iterable<Row<String, String>> getRows(EnumSet<?> columns) throws Exception { int shardCount = config.getShardCount(); List<Future<Rows<String, String>>> futures = new ArrayList<Future<Rows<String, String>>>(); for (int i = 0; i < shardCount; i++) { futures.add(cassandra.selectAsync(generateSelectByShardCql(columns, i))); } List<Row<String, String>> rows = new LinkedList<Row<String, String>>(); for (Future<Rows<String, String>> f: futures) { Rows<String, String> shardRows = f.get(); Iterables.addAll(rows, shardRows); } return rows; } CassandraArchiveRepository(CassandraArchiveRepositoryConfig config);  CassandraArchiveRepository(CassandraArchiveRepositoryConfig config, RepositoryView defaultView); @Override String getRepositoryId(); @Override RepositoryView getDefaultView(); @Override RepositoryView getView(String view); @Override void insertArchive(JarScriptArchive jarScriptArchive); @Override void insertArchive(JarScriptArchive jarScriptArchive, Map<String, Object> initialDeploySpecs); @Override Set<ScriptArchive> getScriptArchives(Set<ModuleId> moduleIds); @Override void deleteArchive(ModuleId moduleId); CassandraArchiveRepositoryConfig getConfig();  }### Answer:
@Test @SuppressWarnings("unchecked") public void testGetRows() throws Exception { EnumSet<Columns> columns = EnumSet.of(Columns.module_id, Columns.module_name); Rows<String, String> mockRows = mock(Rows.class); Row<String, String> row1 = mock(Row.class); Row<String, String> row2 = mock(Row.class); List<Row<String, String>> rowList = Arrays.asList(row1, row2); when(mockRows.iterator()).thenReturn(rowList.iterator()); FutureTask<Rows<String, String>> future = new FutureTask<Rows<String, String>>(new Runnable() { @Override public void run() { } }, mockRows); ExecutorService executor = Executors.newFixedThreadPool(1); executor.execute(future); when(gateway.selectAsync(anyString())).thenReturn(future); repository.getRows(columns); List<String> selectList = new ArrayList<String>(); for (int shardNum = 0; shardNum < config.getShardCount(); shardNum++) { selectList.add(repository.generateSelectByShardCql(columns, shardNum)); } InOrder inOrder = inOrder(gateway); for (int shardNum = 0; shardNum < config.getShardCount(); shardNum++) { inOrder.verify(gateway).selectAsync(selectList.get(shardNum)); } }