TraceInfo (@NotNull StreamCall call, @NotNull Value value) { if (value instanceof ArrayReference array) { if (array.length() != 2) { throw new UnexpectedArrayLengthException("trace array for *match call should contain two items. Actual = " + array.length()); } final Value peeksResult = array.getValue(0); final Value streamResult = array.getValue(1); final TraceElement streamResultElement = TraceElementImpl.ofResultValue(((ArrayReference)streamResult).getValue(0)); final TraceInfo peeksInfo = myPeekResolver.resolve(call, peeksResult); final Collection<TraceElement> traceBeforeFilter = peeksInfo.getValuesOrderBefore().values(); final Map<Integer, TraceElement> traceAfter = peeksInfo.getValuesOrderAfter(); final Collection<TraceElement> traceAfterFilter = traceAfter.values(); final boolean result = getResult(traceBeforeFilter, traceAfterFilter); final Action action = getAction(result); final Map<Integer, TraceElement> beforeTrace = Action.CONNECT_FILTERED.equals(action) ? onlyFiltered(traceAfterFilter) : difference(traceBeforeFilter, traceAfter.keySet()); return new ValuesOrderInfo(call, beforeTrace, makeIndexByTime(Stream.of(streamResultElement))); } throw new UnexpectedValueTypeException("value should be array reference, but given " + value.type().toString()); }