code: public Set<Artifact> filterArtifacts( Set<Artifact> dependencies )
      {
          if ( includes == null && excludes == null )
          {
              return dependencies;
          }
          
          AndArtifactFilter filter = new AndArtifactFilter( );
          if ( includes != null )
          {
              filter.add( new StrictPatternIncludesArtifactFilter( includes ) );
          }
          if ( excludes != null )
          {
              filter.add( new StrictPatternExcludesArtifactFilter( excludes ) );
          }
          
          Set<Artifact> result = new HashSet<Artifact>();
          for ( Artifact artifact : dependencies )
          {
              if ( filter.include( artifact ) )
              {
                  result.add( artifact );
              }
          }
          return result;
      }
docs: /*
  Filter the dependency artifacts according to the includes and excludes
  If includes and excludes are both null, the original set is returned.
  
  @param dependencies the list of dependencies to filter
  @return the resulting set of dependencies