test_class.file: concurrentli/src/test/java/com/concurrentli/VirtualExecutorServiceTest.java
test_class.identifier: VirtualExecutorServiceTest
test_case.body: @Test
    public void shutdownNowTest() throws InterruptedException, ExecutionException {
      ExecutorService baseExecutor = Executors.newFixedThreadPool(4);
      VirtualExecutorService virtualExecutor = new VirtualExecutorService(baseExecutor);
  
      for (int i = 0; i < 10; i++) {
        virtualExecutor.submit(Interrupted.unchecked(() -> {
          while (true) {
            Thread.sleep(Long.MAX_VALUE);
          }
        }));
      }
  
      Thread.sleep(100); // wait a while for the jobs to start
  
      List<Runnable> list = virtualExecutor.shutdownNow();
      Assert.assertEquals(6, list.size());
      virtualExecutor.awaitTermination(10, TimeUnit.SECONDS);
      Assert.assertTrue(virtualExecutor.isTerminated());
      Assert.assertFalse(baseExecutor.isTerminated());
  
      try {
        virtualExecutor.submit(() -> 5);
        Assert.fail();
      } catch (RejectedExecutionException e) {
      } catch (Exception e) {
        Assert.fail();
      }
  
      Assert.assertEquals((int) (baseExecutor.submit(() -> 8).get()), 8);
    }
test_case.class_method_signature: VirtualExecutorServiceTest.shutdownNowTest()
test_case.full_signature: @Test public void shutdownNowTest()
test_case.identifier: shutdownNowTest
test_case.invocations: newFixedThreadPool submit unchecked sleep sleep shutdownNow assertEquals size awaitTermination assertTrue isTerminated assertFalse isTerminated submit fail fail assertEquals get submit
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shutdownNowTest()
focal_class.declarator: _executor
focal_class.modifier: private final
focal_class.original_string: private final Executor _executor;
focal_class.type: Executor
focal_class.var_name: _executor
focal_class.declarator: STAGE_NORMAL = 0
focal_class.modifier: private static final
focal_class.original_string: private static final int STAGE_NORMAL = 0;
focal_class.type: int
focal_class.var_name: STAGE_NORMAL
focal_class.declarator: STAGE_SHUTDOWN = 1
focal_class.modifier: private static final
focal_class.original_string: private static final int STAGE_SHUTDOWN = 1;
focal_class.type: int
focal_class.var_name: STAGE_SHUTDOWN
focal_class.declarator: STAGE_SHUTDOWN_NOW = 2
focal_class.modifier: private static final
focal_class.original_string: private static final int STAGE_SHUTDOWN_NOW = 2;
focal_class.type: int
focal_class.var_name: STAGE_SHUTDOWN_NOW
focal_class.declarator: _stage = STAGE_NORMAL
focal_class.modifier: private
focal_class.original_string: private int _stage = STAGE_NORMAL;
focal_class.type: int
focal_class.var_name: _stage
focal_class.declarator: _pendingLock = new Object()
focal_class.modifier: private final
focal_class.original_string: private final Object _pendingLock = new Object();
focal_class.type: Object
focal_class.var_name: _pendingLock
focal_class.declarator: _pendingRunnables = new LinkedNode<>()
focal_class.modifier: private final
focal_class.original_string: private final LinkedNode<Runnable> _pendingRunnables = new LinkedNode<>();
focal_class.type: LinkedNode<Runnable>
focal_class.var_name: _pendingRunnables
focal_class.declarator: _pendingThreads = new LinkedNode<>()
focal_class.modifier: private final
focal_class.original_string: private final LinkedNode<Thread> _pendingThreads = new LinkedNode<>();
focal_class.type: LinkedNode<Thread>
focal_class.var_name: _pendingThreads
focal_class.file: concurrentli/src/main/java/com/concurrentli/VirtualExecutorService.java
focal_class.identifier: VirtualExecutorService
focal_class.class_method_signature: VirtualExecutorService.VirtualExecutorService(Executor executor)
focal_class.full_signature: public  VirtualExecutorService(Executor executor)
focal_class.identifier: VirtualExecutorService
focal_class.modifiers: public
focal_class.parameters: (Executor executor)
focal_class.signature:  VirtualExecutorService(Executor executor)
focal_class.class_method_signature: VirtualExecutorService.shutdown()
focal_class.full_signature: @Override public void shutdown()
focal_class.identifier: shutdown
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void shutdown()
focal_class.class_method_signature: VirtualExecutorService.shutdownNow()
focal_class.full_signature: @Override public List<Runnable> shutdownNow()
focal_class.identifier: shutdownNow
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<Runnable>
focal_class.signature: List<Runnable> shutdownNow()
focal_class.class_method_signature: VirtualExecutorService.isShutdown()
focal_class.full_signature: @Override public boolean isShutdown()
focal_class.identifier: isShutdown
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isShutdown()
focal_class.class_method_signature: VirtualExecutorService.isTerminated()
focal_class.full_signature: @Override public boolean isTerminated()
focal_class.identifier: isTerminated
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isTerminated()
focal_class.class_method_signature: VirtualExecutorService.awaitTermination(long timeout, TimeUnit unit)
focal_class.full_signature: @Override public boolean awaitTermination(long timeout, TimeUnit unit)
focal_class.identifier: awaitTermination
focal_class.modifiers: @Override public
focal_class.parameters: (long timeout, TimeUnit unit)
focal_class.return: boolean
focal_class.signature: boolean awaitTermination(long timeout, TimeUnit unit)
focal_class.class_method_signature: VirtualExecutorService.execute(Runnable command)
focal_class.full_signature: @Override public void execute(Runnable command)
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: (Runnable command)
focal_class.return: void
focal_class.signature: void execute(Runnable command)
focal_class.superclass: extends AbstractExecutorService
focal_method.body: @Override
    public List<Runnable> shutdownNow() {
      synchronized (_pendingLock) {
        _stage = STAGE_SHUTDOWN_NOW;
  
        for (Thread pending : LinkedNode.values(_pendingThreads)) {
          pending.interrupt();
        }
  
        return LinkedNode.values(_pendingRunnables);
      }
    }
focal_method.class_method_signature: VirtualExecutorService.shutdownNow()
focal_method.full_signature: @Override public List<Runnable> shutdownNow()
focal_method.identifier: shutdownNow
focal_method.invocations: values interrupt values
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: List<Runnable>
focal_method.signature: List<Runnable> shutdownNow()