### Question:
SecHubResultMerger { public SecHubResult merge(SecHubResult result1, SecHubResult result2) { if (result1==null) { return result2; } if (result2==null) { return result1; } SecHubResult merged = new SecHubResult(); mergeFindings(result1, merged); mergeFindings(result2, merged); mergeFalsePositives(result1, merged); mergeFalsePositives(result2, merged); merged.setCount(result1.getCount()+result2.getCount()); return merged; }  SecHubResult merge(SecHubResult result1, SecHubResult result2);  }### Answer:
@Test public void nulls_merged_results_in_null() { assertNull(mergerToTest.merge(null, null)); }
@Test public void null_merged_with_existing_one_returns_existing() { SecHubResult r = new SecHubResult(); assertEquals(r,mergerToTest.merge(r, null)); assertEquals(r,mergerToTest.merge(null,r)); }
@Test public void r1_r2_merged_contains_all_findings() { SecHubResult r1 = new SecHubResult(); SecHubFinding finding1 = new SecHubFinding(); r1.getFindings().add(finding1); SecHubFinding finding2 = new SecHubFinding(); SecHubResult r2 = new SecHubResult(); r2.getFindings().add(finding2); SecHubResult merged = mergerToTest.merge(r1, r2); List<SecHubFinding> findings = merged.getFindings(); assertEquals(2, findings.size()); assertTrue(findings.contains(finding1)); assertTrue(findings.contains(finding2)); }