@Override
  public synchronized String getMessage() {
    if (message != null) return message;

    IMultiset<IMockInvocation> unmatchedMultiInvocations = new HashMultiset<>(unmatchedInvocations);

    StringBuilder builder = new StringBuilder();

    for (IMockInteraction interaction : interactions) {
      builder.append("Too few invocations for:\n\n");
      builder.append(interaction);
      builder.append("\n\n");
      List<ScoredInvocation> scoredInvocations = scoreInvocations(interaction, unmatchedMultiInvocations);
      builder.append("Unmatched invocations (ordered by similarity):\n\n");
      if (scoredInvocations.isEmpty()) {
        builder.append("None\n");
      } else {
        int idx = 0;
        for (ScoredInvocation scoredInvocation : scoredInvocations) {
          builder.append(scoredInvocation.count);
          builder.append(" * ");
          builder.append(scoredInvocation.invocation);
          builder.append('\n');
          if (idx++ < 5) {
            try {
              builder.append(interaction.describeMismatch(scoredInvocation.invocation));
            } catch (AssertionError | Exception e) {
              builder.append("<Renderer threw Exception>: ").append(e.getMessage());
            }
            builder.append('\n');
          }
        }
      }
      builder.append('\n');
    }

    message = builder.toString();
    return message;
  }
Thrown to indicate that one or more mandatory interactions matched too few invocations.

@author Peter Niederwieser
spock-core/src/main/java/org/spockframework/mock/TooFewInvocationsError.java