private static boolean isMatching(Throwable cause, Class<? extends Throwable> causeClass,
      final boolean isSubtypeOk) {
    return isSubtypeOk ? causeClass.isInstance(cause) : causeClass == cause.getClass();
  }
Returns whether the given <code>cause</code> is assignable or has same type as that of
<code>causeClass</code> depending on <code>isSubtypeOk</code> value.

@param cause parent Throwable instance
@param causeClass type of the nested Throwable cause
@param isSubtypeOk whether any matching sub-type is required or exact match is required
@return true if <code>cause</code> is assignable or has same type as that of
        <code>causeClass</code>. false otherwise
geode-gfsh/src/main/java/org/apache/geode/management/internal/cli/util/CauseFinder.java