FilePathUtil { public static String getJarPath(Class<?> clazz) { return clazz.getProtectionDomain().getCodeSource().getLocation().getFile(); }  static String normalizePath(String path); static String simplifyPath(String path); static String concat(String baseName, String... appendName); static String getParentPath(String path); static String getJarPath(Class<?> clazz);  }
@Test public void getJarPath() { System.out.println("the jar file contains Files.class" + FilePathUtil.getJarPath(Files.class)); assertThat(FilePathUtil.getJarPath(Files.class)).endsWith("guava-20.0.jar"); }