### Question:
JournalSegmentFile { public static boolean isSegmentFile(String name, File file) { return isSegmentFile(name, file.getName()); } JournalSegmentFile(File file); static boolean isSegmentFile(String name, File file); static boolean isSegmentFile(String journalName, String fileName); File file();  }### Answer:
@Test public void testIsSegmentFile() throws Exception { assertTrue(JournalSegmentFile.isSegmentFile("foo", "foo-1.log")); assertFalse(JournalSegmentFile.isSegmentFile("foo", "bar-1.log")); assertTrue(JournalSegmentFile.isSegmentFile("foo", "foo-1-1.log")); }