### Question:
IOUtil { public static boolean endsWith(File file, String pathname) { Path path = file.toPath(); Path other = Paths.get(pathname); int i = path.getNameCount() - 1; int j = other.getNameCount() - 1; for (; i >= 0 && j >= 0; i--, j--) { String element = path.getName(i).toString(); String otherElement = other.getName(j).toString(); if (!element.equals(otherElement)) { return false; } } return true; }  static String readAsString(InputStream inputStream); static String readAsString(File file); static void close(Closeable closeable); static boolean endsWith(File file, String pathname);  }### Answer:
@Test public void testEndWith_true() { File file = new File("/fuga/META-INF/piyo/HogeDao/selectById.sql"); String pathname = "META-INF/piyo/HogeDao/selectById.sql"; assertTrue(IOUtil.endsWith(file, pathname)); }
@Test public void testEndWith_false() { File file = new File("/fuga/META-INF/piyo/hogeDao/selectById.sql"); String pathname = "META-INF/piyo/HogeDao/selectById.sql"; assertFalse(IOUtil.endsWith(file, pathname)); }