### Question:
Version { static String valueFromStream(InputStream resourceAsStream, String attributeName) { String version = null; if (resourceAsStream != null) { try { Manifest manifest = new Manifest(resourceAsStream); Attributes attributes = manifest.getMainAttributes(); version = attributes.getValue(attributeName); } catch (IOException e) { } } return version; }  static String getVersion(); static String getVersionInfo(Class mainClass);  }### Answer:
@Test public void getVersionStream() { InputStream is = IOUtils.toInputStream("Implementation-Version: build57\n", StandardCharsets.UTF_8); assertThat(Version.valueFromStream(is, "Implementation-Version"), Is.is("build57")); }
@Test public void getVersionStreamNoVersion() { InputStream is = IOUtils.toInputStream("Implementation-Versionz: build57\n", StandardCharsets.UTF_8); assertNull(Version.valueFromStream(is, "Implementation-Version")); }