### Question:
RecipeExecutionFailureCollector { protected String getRecipePhase(String message) { Matcher matcher = PHASE_PATTERN.matcher(message); if (matcher.matches()) { return matcher.group(1); } return ""; }  boolean canProcessExecutionFailure(CloudbreakOrchestratorException exception); List<RecipeFailure> collectErrors(CloudbreakOrchestratorException exception); Optional<InstanceMetaData> getInstanceMetadataByHost(Set<InstanceMetaData> instanceMetaData, String host);  }### Answer:
@Test public void testRecipePhaseExtract() { String example = "Name: /opt/scripts/recipe-runner.sh pre-cloudera-manager-start failing-recipe"; String result = recipeExecutionFailureHandler.getRecipePhase(example); assertEquals("pre-cloudera-manager-start", result); }
@Test public void testRecipePhaseMultiline() { String example = getSingleLineError(); String result = recipeExecutionFailureHandler.getRecipePhase(example); assertEquals("post-cloudera-manager-start", result); }