### Question:
ObjectFactory { public CoverageReportParser getCoverageReportParser() { if ("cobertura".equals(param.getCoverageType())) { return new XmlCoverageReportParser(new CoberturaCoverageReportHandler()); } else { return new JacocoReportParser(); } } ObjectFactory(Parameter param); DiffParser getDiffReader(); CoverageReportParser getCoverageReportParser(); NewCoverageChecker getNewCoverageParser(); Reporter getReporter(); GithubPullRequestManager getPrManager();  }### Answer:
@Test void getCoberturaCoverageReportParser() throws NoSuchFieldException, IllegalAccessException { CoverageReportParser cobertura = new ObjectFactory(Parameter.builder().coverageType("cobertura").build()).getCoverageReportParser(); Field handler = XmlCoverageReportParser.class.getDeclaredField("handler"); handler.setAccessible(true); assertEquals(CoberturaCoverageReportHandler.class, handler.get(cobertura).getClass()); }
@Test void getJacocoCoverageReportParser() { CoverageReportParser jacoco = new ObjectFactory(Parameter.builder().build()).getCoverageReportParser(); assertEquals(JacocoReportParser.class, jacoco.getClass()); }