App { public static void main(String[] args) { ExecutorService executeService = Executors.newFixedThreadPool(10); ReaderWriterLock lock = new ReaderWriterLock(); IntStream.range(0, 5) .forEach(i -> executeService.submit(new Reader("Reader " + i, lock.readLock()))); IntStream.range(0, 5) .forEach(i -> executeService.submit(new Writer("Writer " + i, lock.writeLock()))); executeService.shutdown(); try { executeService.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { LOGGER.error("Error waiting for ExecutorService shutdown"); } }  static void main(String[] args);  }
@Test public void test() throws Exception { String[] args = {}; App.main(args); }