### Question:
AmbariServer { protected Server configureJettyThreadPool(int acceptorThreads, String threadPoolName, int configuredThreadPoolSize) { int minumumAvailableThreads = 20; int reservedJettyThreads = acceptorThreads * 2; if (configuredThreadPoolSize < reservedJettyThreads + minumumAvailableThreads) { int newThreadPoolSize = reservedJettyThreads + minumumAvailableThreads; LOG.warn( "The configured Jetty {} thread pool value of {} is not sufficient on a host with {} processors. Increasing the value to {}.", threadPoolName, configuredThreadPoolSize, Runtime.getRuntime().availableProcessors(), newThreadPoolSize); configuredThreadPoolSize = newThreadPoolSize; } LOG.info( "Jetty is configuring {} with {} reserved acceptors/selectors and a total pool size of {} for {} processors.", threadPoolName, acceptorThreads * 2, configuredThreadPoolSize, Runtime.getRuntime().availableProcessors()); QueuedThreadPool qtp = new QueuedThreadPool(configuredThreadPoolSize); qtp.setName(threadPoolName); return new Server(qtp); }  String getServerOsType(); static AmbariManagementController getController(); static void setController(AmbariManagementController controller); @SuppressWarnings("deprecation") void run(); void stop(); @Deprecated void performStaticInjection(); void initViewRegistry(); static void setupProxyAuth(); static void enableLog4jMonitor(Map<String, String> configsMap); static void main(String[] args); static final String VIEWS_URL_PATTERN; static final EnumSet<DispatcherType> DISPATCHER_TYPES; volatile boolean running; }### Answer:
@Test public void testJettyThreadPoolCalculation() throws Exception { Server server = new Server(); AmbariServer ambariServer = new AmbariServer(); server = ambariServer.configureJettyThreadPool(12, "mock-pool", 25); Assert.assertEquals(44, ((QueuedThreadPool) server.getThreadPool()).getMaxThreads()); server = ambariServer.configureJettyThreadPool(2, "mock-pool", 25); Assert.assertEquals(25, ((QueuedThreadPool) server.getThreadPool()).getMaxThreads()); server = ambariServer.configureJettyThreadPool(16, "mock-pool", 35); Assert.assertEquals(52, ((QueuedThreadPool) server.getThreadPool()).getMaxThreads()); }