java
code comolles: pubtuc static final Ftlefilter filefiter - new fxlefilterO: Coverride pubire boolean occept(File file) I 1 return ftle.isfile( ) file. canariteO; 1i public static finol filter streasilteri= nem Qirectorystream, Filter( ) i equerride public boolean accept(Path path) throes IOException () 1 return. Files, isRegularfile(poth) \&S Ftles isritable(path): Ii publie static final Predicate pathPredicate - new Predicete() ( Governide putblic boolean test(Poth path) \& 3. retirn. Files.iskegularFile(poth) 8 . Files. isioritable(poth); 3i Suppose we have the following reference implementation of a methed that returns a ilst af wriable thes in a directory, but nat its subdrectories: public static List ariteoble(Path directory) throws I0Exception I try (Strean strean = Files, nalk(directory, i)) \{ return strean, fitter(pathPredicate), tolist O : 3re1 The (aritatit method uses modern fle to fas introduced in Java 7, orivi. 7), hahoies exceptians and resources properiy, is efficieet with respect to funtime and remay une and uses the ivatic; properly such that it is salely reusable by multgie dovelopers. simultaneously. Consider the following aternate implamentations of this method: private static List files = nen ArroyListo O; public List streonIterator(Path start) throns I0exception ( tryc oirectarystrean stream = Files, new0irecterystrean(start); i strean, forEach(files: add): strean, forkach(files: :add): while (iterator, hasNextO) ( if (ipiothpredicote, test (iterator, inext( )) ( t iserator, remove( ) return files: public static Fi le[ Iiseriles (File star ) throms rotiception ( : retuen startisthlies(filefiter): pustic static Liat ficterstrias(Path atart) thcons IOt aceotton ( try3 For the following questions, enter exactly one method name trom the code above. Enter the method name only without the class name; spaces, or symbois. The possible method names are: and Some questians may have multiple coriect answers; enter exaetly one of those arswers Some anawers may be used multiple times, Enter lif thece afe no corect answers for that question. 1. Enter one method that dons NOT use modern lile io: 2. Finer ann methed that dens Nor handie resourcas or excepticns preperly: 3. finter one mathod that does Nor une the stutit keynoid propaiy? code comolles: pubtuc static final Ftlefilter filefiter - new fxlefilterO: Coverride pubire boolean occept(File file) I 1 return ftle.isfile( ) file. canariteO; 1i public static finol filter streasilteri= nem Qirectorystream, Filter( ) i equerride public boolean accept(Path path) throes IOException () 1 return. Files, isRegularfile(poth) \&S Ftles isritable(path): Ii publie static final Predicate pathPredicate - new Predicete() ( Governide putblic boolean test(Poth path) \& 3. retirn. Files.iskegularFile(poth) 8 . Files. isioritable(poth); 3i Suppose we have the following reference implementation of a methed that returns a ilst af wriable thes in a directory, but nat its subdrectories: public static List ariteoble(Path directory) throws I0Exception I try (Strean strean = Files, nalk(directory, i)) \{ return strean, fitter(pathPredicate), tolist O : 3re1 The (aritatit method uses modern fle to fas introduced in Java 7, orivi. 7), hahoies exceptians and resources properiy, is efficieet with respect to funtime and remay une and uses the ivatic; properly such that it is salely reusable by multgie dovelopers. simultaneously. Consider the following aternate implamentations of this method: private static List files = nen ArroyListo O; public List streonIterator(Path start) throns I0exception ( tryc oirectarystrean stream = Files, new0irecterystrean(start); i strean, forEach(files: add): strean, forkach(files: :add): while (iterator, hasNextO) ( if (ipiothpredicote, test (iterator, inext( )) ( t iserator, remove( ) return files: public static Fi le[ Iiseriles (File star ) throms rotiception ( : retuen startisthlies(filefiter): pustic static Liat ficterstrias(Path atart) thcons IOt aceotton ( try3 For the following questions, enter exactly one method name trom the code above. Enter the method name only without the class name; spaces, or symbois. The possible method names are: and Some questians may have multiple coriect answers; enter exaetly one of those arswers Some anawers may be used multiple times, Enter lif thece afe no corect answers for that question. 1. Enter one method that dons NOT use modern lile io: 2. Finer ann methed that dens Nor handie resourcas or excepticns preperly: 3. finter one mathod that does Nor une the stutit keynoid propaiy