IntrabandProxyUtil { protected static void validate( ClassLoader classLoader, Class<?> clazz, boolean skeletonOrStub) { if (clazz.isAnnotation()) { throw new IllegalArgumentException(clazz + " is an annotation"); } if (clazz.isArray()) { throw new IllegalArgumentException(clazz + " is an array"); } if (clazz.isEnum()) { throw new IllegalArgumentException(clazz + " is an enum"); } if (clazz.isPrimitive()) { throw new IllegalArgumentException(clazz + " is a primitive"); } Class<?> reloadedClass = null; try { reloadedClass = Class.forName(clazz.getName(), false, classLoader); } catch (ClassNotFoundException cnfe) { } if (reloadedClass != clazz) { throw new IllegalArgumentException( clazz + " is not visible from class loader " + classLoader); } Field[] fields = clazz.getDeclaredFields(); checkField( fields, _PROXY_METHOD_SIGNATURES_FIELD_NAME, String[].class, true); if (skeletonOrStub) { checkField( fields, _PROXY_METHODS_MAPPING_FIELD_NAME, String.class, true); checkField(fields, "_log", Log.class, true); checkField(fields, "_targetLocator", TargetLocator.class, false); } else { checkField( fields, "_exceptionHandler", ExceptionHandler.class, false); checkField(fields, "_id", String.class, false); checkField(fields, "_intraband", Intraband.class, false); checkField(fields, "_proxyType", byte.class, true); checkField( fields, "_registrationReference", RegistrationReference.class, false); } }  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 testValidate() throws Exception { _doTestValidate(true); _doTestValidate(false); }