@@ -0,0 +1,496 @@
+package com.yutax77.java8_ans.chap1;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0A%0Apublic class Ans12 %7B%0A    %0A    /*%0A     * The following class has compile error.%0A     * %0A     * %5BThe return type is incompatible with Collection%3CString%3E.stream()%0A     * Ans12.java%5D%0A     */%0A    /*%0A    @SuppressWarnings(%22serial%22)%0A    static class Legacy extends ArrayList%3CString%3E %7B%0A%09public Stream%3CString%3E stream() %7B%0A%09    return new Stream%3C%3E();%0A%09%7D%0A    %7D%0A    */%0A    %0A    static class Stream%3CT%3E %7B%0A%09%0A    %7D%0A%7D%0A

Answer chap.1-12