### Question:
DBRecordProvider extends BaseProvider implements RecordProvider, ConnectionPoolListener { @Override public ListRecords listRecords(List<Header> identifiers) throws OaiPmhException { long startTime = System.currentTimeMillis(); List<Record> records = new ArrayList<>(identifiers.size()); List<Future<CollectRecordsResult>> results; List<Callable<CollectRecordsResult>> tasks = new ArrayList<>(); double perThread = identifiers.size() / (double) threadsCount; LOG.debug("{} identifiers and {} threads, so {} records per thread", identifiers.size(), threadsCount, perThread); for (int i = 0; i < threadsCount; i++) { int start = (int) (i * perThread); int end = (int) ((i + 1) * perThread); List<Header> headers = identifiers.subList(start, end); LOG.debug("Creating task {} to retrieve records {} to {}", i, start, end); tasks.add(new CollectRecordsTask(headers, i)); } try { results = threadPool.invokeAll(tasks); CollectRecordsResult collectRecordsResult; for (Future<CollectRecordsResult> result : results) { collectRecordsResult = result.get(); if (LOG.isDebugEnabled()) { LOG.debug("Thread {} collected {} records.", collectRecordsResult.getThreadId(), collectRecordsResult.getRecords().size()); } records.addAll((int) (collectRecordsResult.getThreadId() * perThread), collectRecordsResult.getRecords()); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); LOG.error("Thread interrupted.", e); } catch (ExecutionException e) { String msg = "Error retrieving data"; LOG.error(msg, e); throw new InternalServerErrorException(msg); } if (LOG.isDebugEnabled()) { LOG.debug("ListRecords using {} threads finished in {} ms.", threadsCount, (System.currentTimeMillis() - startTime)); } ListRecords result = new ListRecords(); result.setRecords(records); return result; }  @Override void connectionPoolOpened(ConnectionPoolOpenedEvent connectionPoolOpenedEvent); @Override void connectionPoolClosed(ConnectionPoolClosedEvent connectionPoolClosedEvent); @Override void connectionCheckedOut(ConnectionCheckedOutEvent connectionCheckedOutEvent); @Override void connectionCheckedIn(ConnectionCheckedInEvent connectionCheckedInEvent); @Override void waitQueueEntered(ConnectionPoolWaitQueueEnteredEvent connectionPoolWaitQueueEnteredEvent); @Override void waitQueueExited(ConnectionPoolWaitQueueExitedEvent connectionPoolWaitQueueExitedEvent); @Override synchronized void connectionAdded(ConnectionAddedEvent connectionAddedEvent); @Override synchronized void connectionRemoved(ConnectionRemovedEvent connectionRemovedEvent); @Override @TrackTime Record getRecord(String id); @Override void checkRecordExists(String id); @TrackTime String getEDM(RDF rdf); @TrackTime RDF getRDF(FullBeanImpl bean); @Override ListRecords listRecords(List<Header> identifiers); @Override @PreDestroy void close();  }### Answer:
@Test public void listRecords() throws IOException, EuropeanaException, OaiPmhException { String record = loadRecord(); prepareTest(record); Record preparedRecord = prepareRecord(record); List<Header> headers = new ArrayList<>(); headers.add(preparedRecord.getHeader()); ListRecords retrievedRecords = recordProvider.listRecords(headers); Assert.assertNotNull(retrievedRecords); Assert.assertEquals(1, retrievedRecords.getRecords().size()); assertRecordEquals(retrievedRecords.getRecords().get(0), preparedRecord); }