Transfer a List into a Java Stream,and then delete a element of the List.Some errors occur

The Consumer passed to forEach must be non-interfering. The reasoning is explained below.

Non-interference

Streams enable you to execute possibly-parallel aggregate operations over a variety of data sources, including even non-thread-safe collections such as ArrayList. This is possible only if we can prevent interference with the data source during the execution of a stream pipeline. Except for the escape-hatch operations iterator() and spliterator(), execution begins when the terminal operation is invoked, and ends when the terminal operation completes. For most data sources, preventing interference means ensuring that the data source is not modified at all during the execution of the stream pipeline. The notable exception to this are streams whose sources are concurrent collections, which are specifically designed to handle concurrent modification. Concurrent stream sources are those whose Spliterator reports the CONCURRENT characteristic.

(Source)

BTW, your stringStream.count() would have failed even if the previous stringStream.forEach() statement did not, since forEach (as any terminal operation) consumes the Stream, and a Stream cannot be consumed twice.

The correct way to achieve what you were trying to do is to filter the original List and create a new List:

List<String> filtered = 
    list.stream()
        .filter(m->!m.equals("banana"))
        .collect(Collectors.toList());

You can't use streams to remove elements from a list, but you can use lambda expression by calling removeIf().

List<String> list = new ArrayList<>(Arrays.asList("apple", "banana", "orange"));

list.removeIf(m -> m.equals("banana")); // or: list.removeIf("banana"::equals)

System.out.println(list); // prints: [apple, orange]
System.out.println(list.size()); // prints: 2