public void matchesSnapshot(String snapshotId, BiConsumer<String, String> snapshotMatcher) {
      Checks.notNull(snapshotId, () -> "snapshotId is null");
      Checks.notNull(snapshotMatcher, () -> "snapshotMatcher is null");

      String snapshotValue = loadSnapshot(snapshotId);
      try {
        snapshotMatcher.accept(snapshotValue, value);
        if (snapshotStore.isWriteActualContents()) {
          deleteActual(snapshotId);
        }
      } catch (AssertionError e) {
        if (snapshotStore.isUpdateSnapshots()) {
          saveSnapshot(snapshotId, value);
        } else {
          if (snapshotStore.isWriteActualContents()) {
            saveActual(snapshotId, value);
          }
          throw e;
        }
      }
    }
Allows to specify a custom matcher for the snapshot.
<p>
This is useful when comparing json or similar, which have less strict equality rules.

@param snapshotId      the id of the snapshot to use. In case of multiple snapshots per test, this allows to distinguish them.
@param snapshotMatcher a custom matcher for the snapshot, which is called with the snapshot value and the actual value.
                       The matcher must throw an {@link AssertionError} if the values don't match.
spock-core/src/main/java/spock/lang/Snapshotter.java