### Question:
JsonProvider { public static JsonProvider provider() { return CACHE.get(); } protected  JsonProvider(); static JsonProvider provider(); abstract JsonParser createParser(Reader reader); abstract JsonParser createParser(InputStream in); abstract JsonParserFactory createParserFactory(Map<String, ?> config); abstract JsonGenerator createGenerator(Writer writer); abstract JsonGenerator createGenerator(OutputStream out); abstract JsonGeneratorFactory createGeneratorFactory(Map<String, ?> config); abstract JsonReader createReader(Reader reader); abstract JsonReader createReader(InputStream in); abstract JsonWriter createWriter(Writer writer); abstract JsonWriter createWriter(OutputStream out); abstract JsonWriterFactory createWriterFactory(Map<String, ?> config); abstract JsonReaderFactory createReaderFactory(Map<String, ?> config); abstract JsonObjectBuilder createObjectBuilder(); abstract JsonArrayBuilder createArrayBuilder(); abstract JsonBuilderFactory createBuilderFactory(Map<String, ?> config);  }### Answer:
@Test public void cache() { final JsonProvider provider = JsonProvider.provider(); for (int i = 0; i < 10; i++) { final JsonProvider reload = JsonProvider.provider(); assertSame(provider, reload); } }
@Test public void cacheByClassLoader() { final JsonProvider provider = JsonProvider.provider(); final Thread thread = Thread.currentThread(); final URLClassLoader loader = new URLClassLoader(new URL[0], thread.getContextClassLoader()); thread.setContextClassLoader(loader); try { final JsonProvider subLoaderProvider = JsonProvider.provider(); for (int i = 0; i < 10; i++) { final JsonProvider reload = JsonProvider.provider(); assertNotSame(provider, reload); assertSame(subLoaderProvider, reload); } } finally { thread.setContextClassLoader(loader.getParent()); } }