@Test public void acceptsDirectoryWithLowerBoundIntegerName() { boolean result = procPathFilter.accept(true, Integer.toString(LinuxConstants.LOWEST_LEGAL_PID)); assertTrue(result); }
boolean accept(boolean isDirectory, String fileName) { if (!isDirectory) { return false; } Integer numericalPid = tryParseInt(fileName); return numericalPid != null && numericalPid >= LinuxConstants.LOWEST_LEGAL_PID && numericalPid < pidMax; }
ProcPathFilter implements BiPredicate<Path, BasicFileAttributes> { boolean accept(boolean isDirectory, String fileName) { if (!isDirectory) { return false; } Integer numericalPid = tryParseInt(fileName); return numericalPid != null && numericalPid >= LinuxConstants.LOWEST_LEGAL_PID && numericalPid < pidMax; } }
ProcPathFilter implements BiPredicate<Path, BasicFileAttributes> { boolean accept(boolean isDirectory, String fileName) { if (!isDirectory) { return false; } Integer numericalPid = tryParseInt(fileName); return numericalPid != null && numericalPid >= LinuxConstants.LOWEST_LEGAL_PID && numericalPid < pidMax; } ProcPathFilter(int pidMax); }
ProcPathFilter implements BiPredicate<Path, BasicFileAttributes> { boolean accept(boolean isDirectory, String fileName) { if (!isDirectory) { return false; } Integer numericalPid = tryParseInt(fileName); return numericalPid != null && numericalPid >= LinuxConstants.LOWEST_LEGAL_PID && numericalPid < pidMax; } ProcPathFilter(int pidMax); @Override boolean test(Path path, BasicFileAttributes basicFileAttributes); }
ProcPathFilter implements BiPredicate<Path, BasicFileAttributes> { boolean accept(boolean isDirectory, String fileName) { if (!isDirectory) { return false; } Integer numericalPid = tryParseInt(fileName); return numericalPid != null && numericalPid >= LinuxConstants.LOWEST_LEGAL_PID && numericalPid < pidMax; } ProcPathFilter(int pidMax); @Override boolean test(Path path, BasicFileAttributes basicFileAttributes);  }