### Question:
JournalSegmentFile { static File createSegmentFile(String name, File directory, long id) { return new File(directory, String.format("%s-%d.log", checkNotNull(name, "name cannot be null"), id)); } JournalSegmentFile(File file); static boolean isSegmentFile(String name, File file); static boolean isSegmentFile(String journalName, String fileName); File file();  }### Answer:
@Test public void testCreateSegmentFile() throws Exception { File file = JournalSegmentFile.createSegmentFile("foo", new File(System.getProperty("user.dir")), 1); assertTrue(JournalSegmentFile.isSegmentFile("foo", file)); }