### Question:
ComparisonExecutor { ComparisonConfiguration resolveComparisonConfiguration( ComparisonConfiguration comparisonConfiguration, String baseBuildName) { String lastSuccessFulAlias = configurationRepository.getConfiguration().getAliasForLastSuccessfulBuild(); String mostRecentAlias = configurationRepository.getConfiguration().getAliasForMostRecentBuild(); String baseBranchName = this.aliasResolver.resolveBranchAlias(comparisonConfiguration.getBaseBranchName()); String comparisonBranchName = this.aliasResolver.resolveBranchAlias(comparisonConfiguration.getComparisonBranchName()); boolean isBuildsFromSameBranch = baseBranchName.equals(comparisonBranchName); boolean isComparisonToLastSuccessBuild = comparisonConfiguration.getComparisonBuildName().equals(lastSuccessFulAlias); boolean isComparisonToMostRecentBuild = comparisonConfiguration.getComparisonBuildName().equals(mostRecentAlias); boolean isComparisonToBuildAlias = isComparisonToLastSuccessBuild ||isComparisonToMostRecentBuild; BuildIdentifier comparisonBuildIdentifier; if (isBuildsFromSameBranch && isComparisonToBuildAlias) { comparisonBuildIdentifier = getPreviousBuildIdentifier( comparisonConfiguration, baseBuildName, isComparisonToLastSuccessBuild); } else { comparisonBuildIdentifier = this.aliasResolver.resolveBranchAndBuildAliases( comparisonConfiguration.getComparisonBranchName(), comparisonConfiguration.getComparisonBuildName()); } if (comparisonBuildIdentifier == null || baseBuildName.equals(comparisonBuildIdentifier.getBuildName())) { return null; } return getResolvedComparisonConfiguration(comparisonConfiguration, comparisonBuildIdentifier); } ComparisonExecutor(AliasResolver aliasResolver);   ComparisonExecutor(ThreadPoolExecutor executorService, AliasResolver aliasResolver); void scheduleAllConfiguredComparisonsForOneBuild(String baseBranchName, String baseBuildName); Future<BuildDiffInfo> scheduleComparison(String baseBranchName, String baseBuildName,
													String comparisonBranchName, String comparisonBuildName, String comparisonName); void executeAfterAllPendingComparisonsDone(Runnable task); boolean areAllComparisonCalculationsFinished();  }### Answer:
@Test void testResolveComparisonConfigurationLastSuccessfulSameBranch() { ComparisonConfiguration result = comparisonExecutor.resolveComparisonConfiguration( comparisonConfiguration1, BUILD_NAME_3); assertEquals(BRANCH_NAME_1, result.getBaseBranchName()); assertEquals(BRANCH_NAME_1, result.getComparisonBranchName()); assertEquals(BUILD_NAME_1, result.getComparisonBuildName()); }
@Test void testResolveComparisonConfigurationMostRecentSameBranch() { ComparisonConfiguration result = comparisonExecutor.resolveComparisonConfiguration( comparisonConfiguration2, BUILD_NAME_3); assertEquals(BRANCH_NAME_1, result.getBaseBranchName()); assertEquals(BRANCH_NAME_1, result.getComparisonBranchName()); assertEquals(BUILD_NAME_2, result.getComparisonBuildName()); }
@Test void testResolveComparisonConfigurationLastSuccessfulOtherBranch() { ComparisonConfiguration result = comparisonExecutor.resolveComparisonConfiguration( comparisonConfiguration3, BUILD_NAME_2); assertEquals(BRANCH_NAME_1, result.getBaseBranchName()); assertEquals(BRANCH_NAME_2, result.getComparisonBranchName()); assertEquals(BUILD_NAME_1, result.getComparisonBuildName()); }
@Test void testResolveComparisonConfigurationSameBranchAndSameBuild() { ComparisonConfiguration result = comparisonExecutor.resolveComparisonConfiguration( comparisonConfiguration4, BUILD_NAME_1); assertNull(result); }
@Test void testResolveComparisonConfigurationSameBranchAndBuildWithoutAlias() { ComparisonConfiguration config = getComparisonConfiguration(BRANCH_NAME_1, BRANCH_NAME_2, BUILD_NAME_2, COMPARISON_NAME); ComparisonConfiguration result = comparisonExecutor.resolveComparisonConfiguration( config, BUILD_NAME_1); assertEquals(BRANCH_NAME_1, result.getBaseBranchName()); assertEquals(BRANCH_NAME_2, result.getComparisonBranchName()); assertEquals(BUILD_NAME_2, result.getComparisonBuildName()); }
@Test void testResolveComparisonConfigurationOtherBranchAndBuildWithoutAlias() { ComparisonConfiguration result = comparisonExecutor.resolveComparisonConfiguration( comparisonConfiguration6, BUILD_NAME_1); assertEquals(BRANCH_NAME_2, result.getBaseBranchName()); assertEquals(BRANCH_NAME_2, result.getComparisonBranchName()); assertEquals(BUILD_NAME_3, result.getComparisonBuildName()); }