public static IPeripheral createAdaptedPeripheral(Object target) {
Class<?> targetClass = target.getClass();
ClassMethodsList<IPeripheralMethodExecutor> methods = AdapterManager.peripherals.getAdapterClass(targetClass);
ProxyInterfaces proxyAnn = targetClass.getAnnotation(ProxyInterfaces.class);
if (proxyAnn == null) return new AdapterPeripheral(methods, target);
Set<Class<?>> implemented = ReflectionHelper.getAllInterfaces(targetClass);
Set<Class<?>> blacklist = ImmutableSet.copyOf(proxyAnn.exclude());
Set<Class<?>> proxied = Sets.difference(implemented, blacklist);
if (proxied.isEmpty()) return new AdapterPeripheral(methods, target);
Set<Class<?>> allImplemented = Sets.newHashSet(proxied);
allImplemented.add(IPeripheral.class);
InvocationHandler handler = new ProxyAdapterPeripheral(methods, target);