public StubMapping build() {
   if (scenarioName == null && (requiredScenarioState != null || newScenarioState != null)) {
     throw new IllegalStateException(
         "Scenario name must be specified to require or set a new scenario state");
   }
   RequestPattern requestPattern = requestPatternBuilder.build();
   ResponseDefinition response = responseDefBuilder.build();
   StubMapping mapping = new StubMapping(requestPattern, response);
   mapping.setPriority(priority);
   mapping.setScenarioName(scenarioName);
   mapping.setRequiredScenarioState(requiredScenarioState);
   mapping.setNewScenarioState(newScenarioState);
   return mapping;
 }
 public MappingBuilder withQueryParam(
     final String key, final ValueMatchingStrategy queryParamMatchingStrategy) {
   requestPatternBuilder.withQueryParam(key, queryParamMatchingStrategy);
   return this;
 }
 public MappingBuilder withRequestBody(final ValueMatchingStrategy bodyMatchingStrategy) {
   requestPatternBuilder.withRequestBody(bodyMatchingStrategy);
   return this;
 }
 public MappingBuilder withHeader(
     final String key, final ValueMatchingStrategy headerMatchingStrategy) {
   requestPatternBuilder.withHeader(key, headerMatchingStrategy);
   return this;
 }