private static boolean contains ( int [ ] values , int searchValue ) { Objects . requireNonNull ( values ) ; for ( int value : values ) { if ( searchValue == value ) { return true ; } } return false ; }
Checks an given value exists in an array .