NixVideoDevUtils implements FilenameFilter { @Override public boolean accept(File dir, String name) { return dir.getName().equals("dev") && name.startsWith("video") && (name.length() > 5 && Character.isDigit(name.charAt(5))); }  @Override boolean accept(File dir, String name); static File[] getVideoFiles();  }
@Test public void testAcceptHandlesShortVideoDeviceFilename() { final NixVideoDevUtils videoDeviceFilenameFilter = new NixVideoDevUtils(); assertFalse(videoDeviceFilenameFilter.accept(new File("/dev"), "video")); assertTrue(videoDeviceFilenameFilter.accept(new File("/dev"), "video0")); }