private List < Deployment > archiveDeployments ( List < Deployment > deployments ) { List < Deployment > archives = new ArrayList < Deployment > ( ) ; for ( Deployment deployment : deployments ) { if ( deployment . getDescription ( ) . isArchiveDeployment ( ) ) { archives . add ( deployment ) ; } } return archives ; }
Filters the List of Deployments and returns the ones that are Archive deployments .