package uk.co.littlemike.jextend;

import uk.co.littlemike.jextend.impl.ExtensionConfiguration;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;

public class TestExtension<C, E extends C> implements Extension<C, E> {
    private static final InvocationHandler noOpInvocationHandler = (proxy, method, args) -> null;

    private final Class<C> baseClass;
    private final Class<E> extensionInterface;

    public TestExtension(ExtensionConfiguration<C, E> extensionConfiguration) {
        this.baseClass = extensionConfiguration.getBaseClass();
        this.extensionInterface = extensionConfiguration.getExtensionInterface();
    }

    @SuppressWarnings("unchecked")
    @Override
    public E extend(C object) {
        return (E) Proxy.newProxyInstance(
                TestExtension.class.getClassLoader(),
                new Class[] {extensionInterface},
                noOpInvocationHandler
        );
    }

    public Class<C> getBaseClass() {
        return baseClass;
    }

    public Class<E> getExtensionInterface() {
        return extensionInterface;
    }
}

@@ -360,73 +360,50 @@
 nal 
-Class%3CC%3E baseClass;%0A    private final Class%3CE%3E extensionInterface
+ExtensionConfiguration%3CC, E%3E configuration
 ;%0A%0A 
@@ -455,26 +455,17 @@
 n%3CC, E%3E 
-extensionC
+c
 onfigura
@@ -489,139 +489,37 @@
 his.
-baseClass = extensionConfiguration.getBaseClass();%0A        this.extensionInterface = extensionConfiguration.getExtensionInterface()
+configuration = configuration
 ;%0A  
@@ -730,17 +730,35 @@
 lass%5B%5D %7B
-e
+ configuration.getE
 xtension
@@ -766,16 +766,19 @@
 nterface
+() 
 %7D,%0A     
@@ -884,17 +884,34 @@
 urn 
-b
+configuration.getB
 aseClass
 ;%0A  
@@ -906,16 +906,18 @@
 aseClass
+()
 ;%0A    %7D%0A
@@ -978,17 +978,34 @@
  return 
-e
+configuration.getE
 xtension
@@ -1013,16 +1013,18 @@
 nterface
+()
 ;%0A    %7D%0A

Use ExtensionConfiguration internally in TestExtension