how to check in array list that role match or not code example Example: java arraylist contains string boolean ans = arr.contains("geeks");