public void doDeleteRevisions( PurgeUtilitySpecification purgeSpecification ) throws PurgeDeletionException {
    if ( purgeSpecification != null ) {
      getLogger().setCurrentFilePath( purgeSpecification.getPath() );
      logConfiguration( purgeSpecification );
      if ( purgeSpecification.getPath() != null && !purgeSpecification.getPath().isEmpty() ) {
        processRevisionDeletion( purgeSpecification );
      }

      // Now do shared objects if required
      if ( purgeSpecification.isSharedObjects() ) {
        if ( purgeSpecification.isPurgeFiles() ) {
          for ( String sharedObjectpath : sharedObjectFolders ) {
            purgeSpecification.fileFilter = "*";
            purgeSpecification.setPath( sharedObjectpath );
            processRevisionDeletion( purgeSpecification );
          }
        } else {
          throw new PurgeDeletionException( "Must purge files before shared objects" );
        }
      }
    }
  }
@Test
  public void doPurgeUtilVersionCountTest() throws PurgeDeletionException {
    IUnifiedRepository mockRepo = mock( IUnifiedRepository.class );
    final HashMap<String, List<VersionSummary>> versionListMap = processVersionMap( mockRepo );
    UnifiedRepositoryPurgeService purgeService = getPurgeService( mockRepo );

    PurgeUtilitySpecification spec = new PurgeUtilitySpecification();
    spec.setVersionCount( 3 );
    spec.setPath( "/" );
    purgeService.doDeleteRevisions( spec );

    verifyVersionCountDeletion( versionListMap, mockRepo, "1", spec.getVersionCount() );
    verifyVersionCountDeletion( versionListMap, mockRepo, "2", spec.getVersionCount() );
  }