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