### Question:
FSUtilities { public static String getExtension(String path, int extLevel) { Objects.requireNonNull(path); if (extLevel < 1) { throw new IllegalArgumentException("Bad extention level: " + extLevel); } for (int i = path.length() - 1; i >= 0; i--) { char c = path.charAt(i); if (SEPARATOR_CHARS.indexOf(c) != -1) { return null; } if (c == DOT) { if (--extLevel == 0) { return path.substring(i); } } } return null; }  static String infoMapToString(Map<String, String> info); static String getSafeFilename(String untrustedFilename); static String escapeEncode(String s); static String escapeDecode(String s); static List<GFile> listFileSystem(GFileSystem fs, GFile dir, List<GFile> result,
			TaskMonitor taskMonitor); static String getFilesystemTypeFromClass(Class<?> clazz); static String getFilesystemDescriptionFromClass(Class<?> clazz); static int getFilesystemPriorityFromClass(Class<?> clazz); static boolean isSameFS(List<FSRL> fsrls); static void displayException(Object originator, Component parent, String title,
			String message, Throwable throwable); @SuppressWarnings("resource") static StreamCopyResult streamCopy(InputStream is, OutputStream os, TaskMonitor monitor); static String getStreamMD5(InputStream is, TaskMonitor monitor); static String getFileMD5(File f, TaskMonitor monitor); static String appendPath(String... paths); static String getExtension(String path, int extLevel); static String normalizeNativePath(String path); static final String SEPARATOR_CHARS; static final String SEPARATOR; static final Comparator<GFile> GFILE_NAME_TYPE_COMPARATOR; }### Answer:
@Test public void testGetExtension() { assertEquals(".ext", FSUtilities.getExtension("blah.ext", 1)); assertEquals(".ext", FSUtilities.getExtension("blah.xyz.ext", 1)); assertEquals(".", FSUtilities.getExtension("blah.", 1)); assertNull(FSUtilities.getExtension("blah", 1)); assertNull(FSUtilities.getExtension("blah.ext/filename", 1)); assertEquals(".xyz.ext", FSUtilities.getExtension("blah.xyz.ext", 2)); assertNull(FSUtilities.getExtension("blah.ext", 2)); try { FSUtilities.getExtension("hi", 0); } catch (IllegalArgumentException e) { } }