@Override
  public IMockInteraction match(IMockInvocation invocation) {
    IMockInteraction firstMatch = null;
    for (IMockInteraction interaction : interactions)
      if (interaction.matches(invocation)) {
        if (!interaction.isExhausted()) return interaction;
        if (firstMatch == null) firstMatch = interaction;
      }

    return firstMatch;
  }
A scope for interactions defined outside a then-block

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