### Question:
DefaultBuildContext extends AbstractBuildContext implements BuildContext { @Override public Collection<DefaultResourceMetadata<File>> registerInputs(File basedir, Collection<String> includes, Collection<String> excludes) throws IOException { return super.registerInputs(basedir, includes, excludes); } DefaultBuildContext(BuildContextEnvironment configuration); protected  DefaultBuildContext(Workspace workspace, File stateFile,
      Map<String, Serializable> configuration, BuildContextFinalizer finalizer); @Override Collection<DefaultResource<File>> registerAndProcessInputs(File basedir,
      Collection<String> includes, Collection<String> excludes); @Override void markSkipExecution(); @Override DefaultResourceMetadata<File> registerInput(File inputFile); @Override Collection<DefaultResourceMetadata<File>> registerInputs(File basedir,
      Collection<String> includes, Collection<String> excludes);  }### Answer:
@Test public void testRegisterInputs_includes_excludes() throws Exception { temp.newFolder("folder"); File f1 = temp.newFile("input1.txt"); File f2 = temp.newFile("folder/input2.txt"); File f3 = temp.newFile("folder/input3.log"); TestBuildContext context = newBuildContext(); List<File> actual; actual = toFileList(context.registerInputs(temp.getRoot(), null, Arrays.asList("**"))); assertIncludedPaths(Collections.<File>emptyList(), actual); actual = toFileList(context.registerInputs(temp.getRoot(), null, null)); assertIncludedPaths(Arrays.asList(f1, f2, f3), actual); actual = toFileList(context.registerInputs(temp.getRoot(), Arrays.asList("***.log"))); assertIncludedPaths(Arrays.asList(f1, f2), actual); }
@Test public void testRegisterInputs_directoryMatching() throws Exception { temp.newFolder("folder"); temp.newFolder("folder/subfolder"); File f1 = temp.newFile("input1.txt"); File f2 = temp.newFile("folder/input2.txt"); File f3 = temp.newFile("folder/subfolder/input3.txt"); TestBuildContext context = newBuildContext(); List<File> actual; actual = toFileList(context.registerInputs(temp.getRoot(), Arrays.asList("***.txt"), null)); assertIncludedPaths(Arrays.asList(f2, f3), actual); actual = toFileList(context.registerInputs(temp.getRoot(), Arrays.asList("folder/*.txt"), null)); assertIncludedPaths(Arrays.asList(f2), actual); actual = toFileList(context.registerInputs(temp.getRoot(), Arrays.asList("/"), null)); assertIncludedPaths(Arrays.asList(f1, f2, f3), actual); actual = toFileList(context.registerInputs(temp.getRoot(), Arrays.asList("folder/"), null)); assertIncludedPaths(Arrays.asList(f2, f3), actual); actual = toFileList(context.registerInputs(temp.getRoot(), Arrays.asList("/folder/"), null)); assertIncludedPaths(Arrays.asList(f2, f3), actual); }