### Question:
MiscUtils { public static String resolveFile(String fileName, String topDir) { File file = new File(fileName); if (!file.isAbsolute()) { file = new File(topDir, fileName); } if (!file.exists()) { List<File> files = getDirectoryList(file.getParentFile(), file.getName()); if (files.size() == 1) { file = files.get(0); } else if (files.size() > 1) { throw new IllegalArgumentException("Found more than 1 file, name: " + fileName + " dir:" + topDir); } else { throw new IllegalArgumentException("File does not exist: " + file.getAbsolutePath()); } } return file.getAbsoluteFile().getAbsolutePath(); }  static File combinePath(List<String> paths); static String resolveFile(String fileName, String topDir); static List<File> getDirectoryList(File dir, String glob); static boolean equals(ChaincodeID chaincodeID, Query.ChaincodeInfo chaincodeInfo); static T runWithRetries(int maxRetries, int delaySec, Callable<T> t);  }### Answer:
@Test public void testResolveFilePositive() { assertTrue(MiscUtils.resolveFile("README.md", ".").contains("README.md")); assertTrue(MiscUtils.resolveFile("*.md", ".").contains("README.md")); assertTrue(MiscUtils.resolveFile("fabric-connector/*.md", "..").contains("README.md")); }
@Test(expected = IllegalArgumentException.class) public void testResolveFileByFileNameNegative() { MiscUtils.resolveFile("README.md2", "."); }
@Test(expected = IllegalArgumentException.class) public void testResolveFileByGlobNegative() { MiscUtils.resolveFile("*.md2", "."); }
@Test(expected = IllegalArgumentException.class) public void testResolveFileByGlobMoreThen1Negative() { MiscUtils.resolveFile("*", "."); }