@Test public void testFactoryGivesRightDeciderForNullProject() { assertTrue(factory.createUnzippingDecider(null) instanceof UnzipAllTheThings); }
public UnzippingDecider createUnzippingDecider(Project project) { if (project == null) { return new UnzipAllTheThings(); } switch (project.getProjectType()) { case JAVA_ANT: return new DefaultUnzippingDecider(io, project); case JAVA_MAVEN: return new MavenUnzippingDecider(io, project); case MAKEFILE: return new DefaultUnzippingDecider(io, project); default: return new DefaultUnzippingDecider(io, project); } }
UnzippingDeciderFactory { public UnzippingDecider createUnzippingDecider(Project project) { if (project == null) { return new UnzipAllTheThings(); } switch (project.getProjectType()) { case JAVA_ANT: return new DefaultUnzippingDecider(io, project); case JAVA_MAVEN: return new MavenUnzippingDecider(io, project); case MAKEFILE: return new DefaultUnzippingDecider(io, project); default: return new DefaultUnzippingDecider(io, project); } } }
UnzippingDeciderFactory { public UnzippingDecider createUnzippingDecider(Project project) { if (project == null) { return new UnzipAllTheThings(); } switch (project.getProjectType()) { case JAVA_ANT: return new DefaultUnzippingDecider(io, project); case JAVA_MAVEN: return new MavenUnzippingDecider(io, project); case MAKEFILE: return new DefaultUnzippingDecider(io, project); default: return new DefaultUnzippingDecider(io, project); } } UnzippingDeciderFactory(IOFactory io); }
UnzippingDeciderFactory { public UnzippingDecider createUnzippingDecider(Project project) { if (project == null) { return new UnzipAllTheThings(); } switch (project.getProjectType()) { case JAVA_ANT: return new DefaultUnzippingDecider(io, project); case JAVA_MAVEN: return new MavenUnzippingDecider(io, project); case MAKEFILE: return new DefaultUnzippingDecider(io, project); default: return new DefaultUnzippingDecider(io, project); } } UnzippingDeciderFactory(IOFactory io); UnzippingDecider createUnzippingDecider(Project project); }
UnzippingDeciderFactory { public UnzippingDecider createUnzippingDecider(Project project) { if (project == null) { return new UnzipAllTheThings(); } switch (project.getProjectType()) { case JAVA_ANT: return new DefaultUnzippingDecider(io, project); case JAVA_MAVEN: return new MavenUnzippingDecider(io, project); case MAKEFILE: return new DefaultUnzippingDecider(io, project); default: return new DefaultUnzippingDecider(io, project); } } UnzippingDeciderFactory(IOFactory io); UnzippingDecider createUnzippingDecider(Project project);  }