IntrabandProxyUtil { public static <T> T newStubInstance( Class<? extends T> stubClass, String id, RegistrationReference registrationReference, ExceptionHandler exceptionHandler) { try { Constructor<? extends T> constructor = stubClass.getConstructor( String.class, RegistrationReference.class, ExceptionHandler.class); return constructor.newInstance( id, registrationReference, exceptionHandler); } catch (Exception e) { throw new RuntimeException(e); } }  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 testNewStubInstance() { Class<?> stubClass = IntrabandProxyUtil.getStubClass( TestGenerateInterface1.class, "skeletonId"); IntrabandProxyUtil.newStubInstance( stubClass, "id", new MockRegistrationReference(null), WarnLogExceptionHandler.INSTANCE); try { IntrabandProxyUtil.newStubInstance( stubClass, "id", null, WarnLogExceptionHandler.INSTANCE); Assert.fail(); } catch (RuntimeException re) { Throwable throwable = re.getCause(); throwable = throwable.getCause(); Assert.assertSame(NullPointerException.class, throwable.getClass()); Assert.assertEquals( "Registration reference is null", throwable.getMessage()); } stubClass = IntrabandProxyUtil.getStubClass( TestGenerateInterface2.class, "skeletonId"); try { IntrabandProxyUtil.newStubInstance( stubClass, "id", null, WarnLogExceptionHandler.INSTANCE); Assert.fail(); } catch (RuntimeException re) { Throwable throwable = re.getCause(); throwable = throwable.getCause(); Assert.assertSame(NullPointerException.class, throwable.getClass()); Assert.assertEquals( "Registration reference is null", throwable.getMessage()); } IntrabandProxyUtil.newStubInstance( stubClass, "id", new MockRegistrationReference(null), WarnLogExceptionHandler.INSTANCE); }