### Question:
DirectIo { public static <T> ModelInput<T> open( Class<? extends DataFormat<T>> formatClass, String basePath, String resourcePattern) throws IOException { return STUB.get().open(formatClass, basePath, resourcePattern); } private  DirectIo(); static ModelInput<T> open(
            Class<? extends DataFormat<T>> formatClass,
            String basePath,
            String resourcePattern); static ApiStub<DirectIoApi> getStub();  }### Answer:
@Test public void simple() throws Exception { File root = injectDataSource("testing", folder.newFolder()); env.reload(); put(new File(root, "testing.txt"), "Hello, world!"); Set<String> results; try (ModelInput<StringBuilder> input = DirectIo.open(MockFormat.class, "testing", "*.txt")) { results = consume(input); } assertThat(results, is(set("Hello, world!"))); }
@Test public void missing() throws Exception { injectDataSource("testing", folder.newFolder()); env.reload(); Set<String> results; try (ModelInput<StringBuilder> input = DirectIo.open(MockFormat.class, "testing", "*.txt")) { results = consume(input); } assertThat(results, is(empty())); }
@Test public void multiple() throws Exception { File root = injectDataSource("testing", folder.newFolder()); env.reload(); put(new File(root, "t1.txt"), "Hello1"); put(new File(root, "t2.txt"), "Hello2"); put(new File(root, "t3.txt"), "Hello3"); Set<String> results; try (ModelInput<StringBuilder> input = DirectIo.open(MockFormat.class, "testing", "*.txt")) { results = consume(input); } assertThat(results, is(set("Hello1", "Hello2", "Hello3"))); }