### Question:
StringUtil { public static List<Node> getFileList(Torrent torrent) { if (torrent.getFiles() == null) { int pos = torrent.getFileName().lastIndexOf("."); String sname = torrent.getFileName(); if (pos > 0) torrent.setFileName(sname.substring(0, pos)); return Arrays.asList(new Node(1, 0, sname, torrent.getFileSize(), 1)); } Tree tree = JSONUtil.parseObject(torrent.getFiles(), Tree.class); return tree.getLeafList(); }  static String getMiddleString(String text, String lStr, String rStr); static String deleteCRLFOnce(String input); static String str2HexStr(String str); static String hexStr2Str(String hexStr); static String byte2HexStr(byte[] b); static byte[] hexStr2Bytes(String src); static String str2Unicode(String strText); static String unicode2Str(String hex); static String delTagsFContent(String content); static String formatSize(double size); static String getEncoding(byte[] bytes); static List<Node> getFileList(Torrent torrent); static CodepageDetectorProxy detector; }### Answer:
@Test public void testGetFileList() { assertEquals(new Node(1, 0, "foo.bar", 0L, 1), StringUtil.getFileList( new Torrent(null, null, "foo.bar", 0L, 0L, null)).get(0)); }