public static bool Interleave(InvokeMethodRequest req) => req.Message(x => x is GetStreamMessagesInProgress || x is int); // int is 1-st stream message type
public static bool Interleave(InvokeMethodRequest req) => req.Message() is GetDetails;
public static bool Interleave(InvokeMethodRequest req) => req.Message() is ReentrantMessage;
public static bool Message(this InvokeMethodRequest request, Func <object, bool> predicate) => predicate(request.Message());
public static bool Message <T>(this InvokeMethodRequest request, Func <T, bool> predicate) => request.Message() is T m && predicate(m);
public static T Message <T>(this InvokeMethodRequest request) => (T)request.Message();
public static bool Any(this InvokeMethodRequest request, params Type[] messages) { var message = request.Message().GetType(); return(messages.Any(x => x == message)); }