### Question:
ResourceUtils { public static boolean isFileReadable(String path) { try { Path pathToFile = Paths.get(path); return Files.isRegularFile(pathToFile) && Files.isReadable(pathToFile); } catch (RuntimeException e) { LOGGER.debug("Failed to check if path exists as a regular file and is readable: " + path, e); return false; } } private  ResourceUtils(); static boolean isResourceAccessible(String path); static boolean isFileReadable(String path);  }### Answer:
@Test public void isFileReadableShouldReturnTrueIfPathRefersToExistingFile() { Path path = Paths.get("pom.xml"); Assert.assertTrue(Files.isRegularFile(path) && Files.isReadable(path)); Assert.assertTrue(ResourceUtils.isFileReadable(path.toString())); }
@Test public void isFileReadableShouldReturnFalseIfPathRefersToExistingDirectory() { Path path = Paths.get("target"); Assert.assertTrue(Files.isDirectory(path)); Assert.assertFalse(ResourceUtils.isFileReadable(path.toString())); }
@Test public void isFileReadableShouldReturnFalseIfNoSuchFileExists() { Path path = Paths.get("non_existing_file"); Assert.assertFalse(ResourceUtils.isFileReadable(path.toString())); }