question: private boolean hasPort ( List < ServicePort > ports , ServicePort port ) { for ( ServicePort aPort : ports ) { if ( Objects . equals ( port . getPort ( ) , aPort . getPort ( ) ) ) { return true ; } } return false ; }
target:  Returns true if the given port can be found in the collection