IntrabandProxyUtil { protected static MethodsBag extractMethods(Class<?> clazz) { List<Method> idMethods = new ArrayList<>(); List<Method> proxyMethods = new ArrayList<>(); List<Method> emptyMethods = new ArrayList<>(); for (Method method : ReflectionUtil.getVisibleMethods(clazz)) { Id id = method.getAnnotation(Id.class); if (id != null) { if (Modifier.isStatic(method.getModifiers())) { throw new IllegalArgumentException( "The @Id annotated method " + method + " must not be static"); } Class<?>[] parameterTypes = method.getParameterTypes(); if (parameterTypes.length > 0) { throw new IllegalArgumentException( "The @Id annotated method " + method + " must not have parameters"); } if (method.getReturnType() != String.class) { throw new IllegalArgumentException( "The @Id annotated method " + method + " must not return String"); } idMethods.add(method); continue; } Proxy proxy = method.getAnnotation(Proxy.class); if (proxy != null) { if (Modifier.isStatic(method.getModifiers())) { throw new IllegalArgumentException( "Static proxy method violation for " + method); } proxyMethods.add(method); continue; } if (Modifier.isAbstract(method.getModifiers())) { emptyMethods.add(method); } } return new MethodsBag(idMethods, proxyMethods, emptyMethods); }  static String[] getProxyMethodSignatures(Class<?> clazz); static Class<?> getStubClass(Class<?> clazz, String skeletonId); static Class<?> getStubClass(
		ClassLoader classLoader, Class<?> clazz, String skeletonId); static T newStubInstance(
		Class<? extends T> stubClass, String id,
		RegistrationReference registrationReference,
		ExceptionHandler exceptionHandler); static final String SKELETON_POSTFIX; static final String STUB_POSTFIX; }
@Test public void testExtractMethods() throws Exception { try { IntrabandProxyUtil.extractMethods(TestExtractMethodsClass1.class); Assert.fail(); } catch (IllegalArgumentException iae) { Assert.assertEquals( "The @Id annotated method " + TestExtractMethodsClass1.class.getMethod("getId") + " must not be static", iae.getMessage()); } try { IntrabandProxyUtil.extractMethods(TestExtractMethodsClass2.class); Assert.fail(); } catch (IllegalArgumentException iae) { Assert.assertEquals( "The @Id annotated method " + TestExtractMethodsClass2.class.getMethod( "getId", Object.class) + " must not have parameters", iae.getMessage()); } try { IntrabandProxyUtil.extractMethods(TestExtractMethodsClass3.class); Assert.fail(); } catch (IllegalArgumentException iae) { Assert.assertEquals( "The @Id annotated method " + TestExtractMethodsClass3.class.getMethod("getId") + " must not return String", iae.getMessage()); } try { IntrabandProxyUtil.extractMethods(TestExtractMethodsClass4.class); Assert.fail(); } catch (IllegalArgumentException iae) { Assert.assertEquals( "Static proxy method violation for " + TestExtractMethodsClass4.class.getMethod("doStuff"), iae.getMessage()); } MethodsBag methodsBag = IntrabandProxyUtil.extractMethods( TestExtractMethodsClass5.class); List<Method> idMethods = methodsBag.idMethods; Assert.assertEquals(2, idMethods.size()); Assert.assertTrue( idMethods.contains( TestExtractMethodsClass5.class.getMethod("getId1"))); Assert.assertTrue( idMethods.contains( TestExtractMethodsClass5.class.getMethod("getId2"))); List<Method> proxyMethods = methodsBag.proxyMethods; Assert.assertEquals(2, proxyMethods.size()); Assert.assertEquals( TestExtractMethodsClass5.class.getMethod("doStuff1"), proxyMethods.get(0)); Assert.assertEquals( TestExtractMethodsClass5.class.getMethod("doStuff2"), proxyMethods.get(1)); List<Method> emptyMethods = methodsBag.emptyMethods; Assert.assertEquals(1, emptyMethods.size()); Assert.assertEquals( TestExtractMethodsClass5.class.getMethod("doStuff4"), emptyMethods.get(0)); String[] proxyMethodSignatures = methodsBag.proxyMethodSignatures; Assert.assertEquals(2, proxyMethodSignatures.length); Assert.assertEquals("doStuff1-()V", proxyMethodSignatures[0]); Assert.assertEquals("doStuff2-()V", proxyMethodSignatures[1]); }