RunningFromJar { public static String getVersionNumberOrNull() { String filePath = getJarFilePathOrNull(RunningFromJar.class); if (filePath == null) { return null; } return filePath.substring((filePath.lastIndexOf("-") + 1), (filePath.length() - 4)); }  static String getVersionNumberOrNull(); static String getJarFilePathOrNull(Class<?> clazz);  }
@Test public void testGetVersionNumberOrNull() { assumeThat("", is("")); assertThat(RunningFromJar.getVersionNumberOrNull(), nullValue()); }