} else if (t instanceof ExecutionException) {
final Throwable cause = t.getCause();
if (cause != null) {
throw rethrow(cause, allowedType);
} else {
throw new HazelcastException(t);
}
} else if (allowedType.isAssignableFrom(t.getClass())) {
throw (T) t;
} else {
throw new HazelcastException(t);
}
}