### Question:
Configurer { public final <T> T getImplementation(Class<T> type, String... path) { return getImplementation(getClass().getClassLoader(), type, path); } Configurer(Media media); static void clearCache(); final void save(); final Xml getRoot(); final String getPath(); final Media getMedia(); final String getText(String... path); final String getTextDefault(String defaultValue, String... path); final String getString(String attribute, String... path); final String getStringDefault(String defaultValue, String attribute, String... path); final boolean getBoolean(String attribute, String... path); final boolean getBooleanDefault(boolean defaultValue, String attribute, String... path); final int getInteger(String attribute, String... path); final int getIntegerDefault(int defaultValue, String attribute, String... path); final double getDouble(String attribute, String... path); final double getDoubleDefault(double defaultValue, String attribute, String... path); final T getImplementation(Class<T> type, String... path); final T getImplementation(ClassLoader loader, Class<T> type, String... path); final T getImplementation(Class<T> type, Class<?> paramType, Object paramValue, String... path); final T getImplementation(Class<T> type,
                                         Class<?>[] paramsType,
                                         Collection<?> paramsValue,
                                         String... path); final T getImplementation(ClassLoader loader,
                                         Class<T> type,
                                         Class<?>[] paramsType,
                                         Collection<?> paramsValue,
                                         String... path); static final T getImplementation(ClassLoader loader,
                                                Class<T> type,
                                                Class<?>[] paramsType,
                                                Collection<?> paramsValue,
                                                String className); final boolean hasNode(String... path);  }### Answer:
@Test void testGetImplementationDefault() { final Accessible impl = configurer.getImplementation(Accessible.class, Accessible.class.getSimpleName()); assertTrue(impl.created); }
@Test void testGetImplementationNotAccessible() { final NotAccessible impl = configurer.getImplementation(NotAccessible.class, NotAccessible.class.getSimpleName()); assertTrue(impl.created); }
@Test void testGetImplementationCustom() { final Custom impl = configurer.getImplementation(Custom.class, Boolean.class, Boolean.TRUE, Custom.class.getSimpleName()); assertTrue(impl.created); }
@Test void testGetImplementationCustomInvalidArgument() { assertCause(() -> configurer.getImplementation(Custom.class, Boolean.class, Constant.EMPTY_STRING, Custom.class.getSimpleName()), IllegalArgumentException.class); }
@Test void testGetImplementationCustomAbstract() { assertCause(() -> configurer.getImplementation(Abstract.class, UtilReflection.getParamTypes(Boolean.TRUE), Arrays.asList(Boolean.TRUE), Abstract.class.getSimpleName()), InstantiationException.class); }
@Test void testGetImplementationUnknown() { assertCause(() -> configurer.getImplementation(Object.class, "unknown"), ClassNotFoundException.class); }
@Test void testGetImplementationNoCompatibleConstructor() { assertCause(() -> configurer.getImplementation(Accessible.class, UtilReflection.getParamTypes(Boolean.TRUE), Arrays.asList(Boolean.TRUE), Accessible.class.getSimpleName()), NoSuchMethodException.class); }
@Test void testGetImplementationConstructorThrows() { assertCause(() -> configurer.getImplementation(Throws.class, Throws.class.getSimpleName()), InvocationTargetException.class); }