@@ -0,0 +1,1121 @@
+package com.yutax77.java8_ans.chap8;%0A%0Aimport java.io.IOException;%0Aimport java.io.UncheckedIOException;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.util.concurrent.atomic.AtomicInteger;%0Aimport java.util.stream.Stream;%0A%0A%0Apublic class Ans10 %7B%0A    public static void walk(Path target) throws IOException %7B%0A        AtomicInteger count = new AtomicInteger();%0A        Files.walk(target).filter(p -%3E %7B%0A            return p.toFile().getAbsolutePath().endsWith(%22.java%22);%0A        %7D).flatMap(p -%3E %7B%0A            String s = readAll(p);%0A            if(s.contains(%22volatile%22) && s.contains(%22transient%22)) %7B%0A                return Stream.of(p);%0A            %7D else %7B%0A                return Stream.empty();%0A            %7D%0A        %7D).forEach(p -%3E %7B%0A            System.out.println(p);%0A            count.incrementAndGet();%0A        %7D);%0A        %0A        System.out.println(%22Hit:%22 + count.get());%0A    %7D%0A    %0A    private static String readAll(Path path) %7B%0A        try %7B%0A            return new String(Files.readAllBytes(path));%0A        %7D catch (IOException e) %7B%0A            throw new UncheckedIOException(e);%0A        %7D%0A    %7D%0A%7D%0A

Answer chap.8-10