Why is it wrong to rewrite lambda expressions with objects?

the following code:

public class App {
    public static void main(String[] args) throws IOException
    {
        class Test<T extends Comparable> implements Predicate<T> {
            public boolean test(T t){
                return t.equals("grayVTouch");
            }
        }
        ArrayList<String> a = new ArrayList<>();
        a.add("grayVTouch");
        a.add("yueshu");
        a.add("shuyue");
        Stream<String> s = a.stream();
        Test<String> t = new Test<>();
        a = a.filter(t);
    }
}

error report:

clipboard.png

Why is this?

Aug.19,2021

filter is the method of stream , not the method of ArrayList , so it should be s.filter . The s of the subject is initialized, isn't it gray? Doesn't that mean you haven't used it? (cover your face)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5edcf-457de.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5edcf-457de.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?