PatternExclusionsDependencyFilter extends PatternInclusionsDependencyFilter { @Override public boolean accept( final DependencyNode node, List<DependencyNode> parents ) { final Dependency dependency = node.getDependency(); if ( dependency == null ) { return true; } return !super.accept( node, parents ); } PatternExclusionsDependencyFilter( final String... patterns );  PatternExclusionsDependencyFilter( final VersionScheme versionScheme, final String... patterns );  PatternExclusionsDependencyFilter( final Collection<String> patterns );  PatternExclusionsDependencyFilter( final VersionScheme versionScheme, final Collection<String> patterns ); @Override boolean accept( final DependencyNode node, List<DependencyNode> parents );  }
@Test public void acceptTestCornerCases() { NodeBuilder builder = new NodeBuilder(); builder.artifactId( "testArtifact" ); DependencyNode node = builder.build(); List<DependencyNode> parents = new LinkedList<DependencyNode>(); assertTrue( dontAccept( node, "" ) ); assertTrue( new PatternExclusionsDependencyFilter( new LinkedList<String>() ).accept( node, parents ) ); assertTrue( new PatternExclusionsDependencyFilter( (String[]) null ).accept( node, parents ) ); assertTrue( new PatternExclusionsDependencyFilter( (VersionScheme) null, "[1,10]" ).accept( node, parents ) ); }