public void matchesSnapshot(String snapshotId) {
      matchesSnapshot(snapshotId, (expected, actual) -> {
        if (!Objects.equals(expected, actual)) {
          // manually construct a ConditionNotSatisfiedError, as the native groovy assert doesn't get properly rendered by Intellij
          throw new ConditionNotSatisfiedError(new Condition(Arrays.asList(value, expected), "value == snapshotValue", TextPosition.create(-1, -1), null, null, null));
        }
      });
    }
Asserts that the actual value matches the snapshot using string equality.

@param snapshotId the id of the snapshot to use. In case of multiple snapshots per test, this allows to distinguish them.
spock-core/src/main/java/spock/lang/Snapshotter.java