public class test2 {
public static void main(String args[]) {
String ids=”1,2,3,4,5″;
List<Object> listIds = Arrays.asList(ids.split(“,”)).stream().collect(Collectors.toList());
boolean result = listIds.stream().anyMatch(p->p.equals(“2”));
System.out.println(Arrays.toString(listIds .toArray()));//[1,2,3,3,4,5,6]
System.out.println(result);
}
}