### Question:
BufferStrategyFactory { public static BufferStrategy valueOf(String strategyName) { BufferStrategy bufferStrategy = DEFAULT_STRATEGIES.get(strategyName.toUpperCase(Locale.ENGLISH)); if (bufferStrategy == null) { Class<?> bsClass = ClassUtil.loadClassOptional(strategyName, false); if (bsClass == null || bsClass.isAssignableFrom(BufferStrategy.class)) { throw new IllegalArgumentException("Could not load Johnzon BufferStrategy " + strategyName + ". Valid BufferStrategies are " + DEFAULT_STRATEGIES.keySet().toString() + " or a fully qualified class name of an implementation of " + BufferStrategy.class.getName()); } try { bufferStrategy = (BufferStrategy) bsClass.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException(e); } } return bufferStrategy; } private  BufferStrategyFactory(); static BufferStrategy valueOf(String strategyName);  }### Answer:
@Test public void testDefaultStrategies() { verify(BufferStrategyFactory.valueOf("BY_INSTANCE")); verify(BufferStrategyFactory.valueOf("THREAD_LOCAL")); verify(BufferStrategyFactory.valueOf("QUEUE")); verify(BufferStrategyFactory.valueOf("SINGLETON")); }
@Test(expected = IllegalArgumentException.class) public void testNotExistingStrategy() { BufferStrategyFactory.valueOf("NOT_EXISTING"); }
@Test public void testFqcnBufferStrategy() { verify(BufferStrategyFactory.valueOf(DummyBufferStrategy.class.getName())); }