@NotNull
  private static Map<TraceElement, List<TraceElement>> resolve(@NotNull Value value,
                                                               @NotNull TraceInfo order,
                                                               @NotNull Direction direction) {
    if (value instanceof ArrayReference convertedMap) {
      final Value keys = convertedMap.getValue(0);
      final Value values = convertedMap.getValue(1);
      if (keys instanceof ArrayReference keysArray && values instanceof ArrayReference valuesArray) {
        return Direction.DIRECT.equals(direction)
               ? resolveDirectTrace(keysArray, valuesArray, order)
               : resolveReverseTrace(keysArray, valuesArray, order);
      }

      throw new UnexpectedValueException("keys and values arrays must be arrays");
    }

    throw new UnexpectedValueException("value must be an array reference");
  }
@NotNull
  private static Map<TraceElement, List<TraceElement>> resolve(@NotNull Value value,
                                                               @NotNull TraceInfo order,
                                                               @NotNull Direction direction)