@Test public void testCreateNullFileReader() { ContentReader reader = factory.createContentReader("any-non-existing-type"); assertTrue(reader instanceof NullFileReader); }
public ContentReader createContentReader(String type) { if (type.equals("local")) { return new LocalFileReader(); } else if (type.equals("web")) { return new WebFileReader(); } else { return new NullFileReader(); } }
ContentReaderFactory { public ContentReader createContentReader(String type) { if (type.equals("local")) { return new LocalFileReader(); } else if (type.equals("web")) { return new WebFileReader(); } else { return new NullFileReader(); } } }
ContentReaderFactory { public ContentReader createContentReader(String type) { if (type.equals("local")) { return new LocalFileReader(); } else if (type.equals("web")) { return new WebFileReader(); } else { return new NullFileReader(); } }  }
ContentReaderFactory { public ContentReader createContentReader(String type) { if (type.equals("local")) { return new LocalFileReader(); } else if (type.equals("web")) { return new WebFileReader(); } else { return new NullFileReader(); } }  ContentReader createContentReader(String type); }
ContentReaderFactory { public ContentReader createContentReader(String type) { if (type.equals("local")) { return new LocalFileReader(); } else if (type.equals("web")) { return new WebFileReader(); } else { return new NullFileReader(); } }  ContentReader createContentReader(String type);  }