@Test
public void addRemoveReadersMultiThreaded() throws Exception {

  ReaderPlugin plugin = new BlankAbstractPlugin("addRemoveReadersMultiThreaded");
  Map<String, SeReader> readers = plugin.getReaders();
  final CountDownLatch lock = new CountDownLatch(10);
  addReaderThread(readers, 10, lock);
  addReaderThread(readers, 10, lock);
  removeReaderThread(readers, 10, lock);
  listReaders(readers, 10, lock);
  addReaderThread(readers, 10, lock);
  removeReaderThread(readers, 10, lock);
  listReaders(readers, 10, lock);
  removeReaderThread(readers, 10, lock);
  listReaders(readers, 10, lock);
  removeReaderThread(readers, 10, lock);
  // wait for all thread to finish with timeout
  lock.await(2, TimeUnit.SECONDS);
  // if all thread finished correctly, lock count should be 0
  Assert.assertEquals(0, lock.getCount());
}