### Question:
Funky { public static void setThreadSafeInput(boolean threadSafe) { if (threadSafe) { factory = createThreadSafeFactory(); } else { factory = createSingleThreadFactory(); } } protected  Funky(); static ClassFunction<T> newFunction(Class<T> applyingClass, Object... constructorArguments); static ClassFunctionWithInput<T> newFunctionWithInput(Class<T> applyingClass, Object... constructorArguments); static void setThreadSafeInput(boolean threadSafe); static T getInput();  }### Answer:
@Test public void switchToSingleThreadFactory() throws Exception { Funky.setThreadSafeInput(false); FunctionFactory factory = getFactory(); InputHolder inputHolder = factory.getInputHolder(); assertTrue(inputHolder instanceof SingleThreadInputHolder); }
@Test public void doubleSwitchToThreadSafeFactory() throws Exception { Funky.setThreadSafeInput(false); Funky.setThreadSafeInput(true); FunctionFactory factory = getFactory(); InputHolder inputHolder = factory.getInputHolder(); assertTrue(inputHolder instanceof ThreadSafeInputHolder); }