private void induceListenerMalfunctioning(boolean throwError, FailureType failureType) throws Throwable {
Cache cache1 = cache(0, "replSync");
Cache cache2 = cache(1, "replSync");
ErrorInducingListener listener = new ErrorInducingListener(throwError);
cache2.addListener(listener);
try {
cache1.put(failureType, 1);
} catch (RemoteException e) {
Throwable cause = e.getCause(); // get the exception behind the remote one
if (throwError && cause.getCause() instanceof InvocationTargetException)