SwiftMojo extends AbstractMojo { @VisibleForTesting static boolean canBypassScan( List<String> includedFiles, List<String> excludedFiles) { return excludedFiles.isEmpty() && !includedFiles.isEmpty() && includedFiles .stream() .noneMatch(s -> requiresScan(s)); }  @Override final void execute();  }
@Test public void posixFormat() { assertTrue(canBypassScan("foo", "bar", "bar/foo/coo")); assertTrue(canBypassScan("foo/bar/./bar")); assertFalse(canBypassScan()); assertFalse(canBypassScan("foo", "???bar.java")); assertFalse(canBypassScan("foo*/java", "bar")); assertFalse(canBypassScan("foo", "bar/../../foo")); assertFalse(canBypassScan("foo", "bar/")); assertFalse(canBypassScan("/foo", "bar")); }
@Test public void windowsFormat() { assertTrue(canBypassScan("foo", "bar", "bar\\foo\\coo")); assertTrue(canBypassScan("foo\\bar\\.\\bar")); assertFalse(canBypassScan()); assertFalse(canBypassScan("foo", "???bar.java")); assertFalse(canBypassScan("foo\\**\\*\\java", "bar")); assertFalse(canBypassScan("foo", "bar\\..\\..\\foo")); assertFalse(canBypassScan("foo", "bar\\")); assertFalse(canBypassScan("\\foo", "bar")); }