@Test
  public void newFunctionThreadPoolWithFeedStatistics() {
    int poolSize = 5;
    int workQueueSize = 2;
    String threadName = "thread";

    ExecutorService executorService = CoreLoggingExecutors
        .newFunctionThreadPoolWithFeedStatistics(poolSize, workQueueSize, queueStatHelper,
            threadName, threadInitializer, commandWrapper, poolStatHelper, threadsMonitoring);

    assertThat(executorService).isInstanceOf(FunctionExecutionPooledExecutor.class);

    FunctionExecutionPooledExecutor executor = (FunctionExecutionPooledExecutor) executorService;

    assertThat(executor.getBufferQueue()).isInstanceOf(OverflowQueueWithDMStats.class);
    assertThat(executor.getCorePoolSize()).isEqualTo(1);
    assertThat(executor.getKeepAliveTime(MINUTES)).isEqualTo(30);
    assertThat(executor.getMaximumPoolSize()).isEqualTo(poolSize);
    assertThat(executor.getQueue()).isInstanceOf(SynchronousQueue.class);
    assertThat(executor.getRejectedExecutionHandler())
        .isInstanceOf(FunctionExecutionRejectedExecutionHandler.class);
    assertThat(executor.getThreadFactory()).isInstanceOf(LoggingThreadFactory.class);

    OverflowQueueWithDMStats overflowQueueWithDMStats =
        (OverflowQueueWithDMStats) executor.getBufferQueue();

    assertThat(overflowQueueWithDMStats.getQueueStatHelper()).isSameAs(queueStatHelper);

    ThreadFactory threadFactory = executor.getThreadFactory();
    Thread thread = threadFactory.newThread(runnable);

    assertThat(thread).isInstanceOf(LoggingThread.class);
    assertThat(thread.getName()).contains(threadName);
  }
Creates and passes in OverflowQueueWithDMStats. FunctionExecutionPooledExecutor then creates
and passes up SynchronousQueue, but finally uses OverflowQueueWithDMStats.

<p>
{@code getBufferQueue()} returns passed-in OverflowQueueWithDMStats. {@code getQueue()} returns
internal SynchronousQueue.

<p>
Uses {@code ThreadPoolExecutor.AbortPolicy}.
geode-core/src/test/java/org/apache/geode/internal/logging/CoreLoggingExecutorsTest.java