### Question:
MavenProjectProperties implements ProjectProperties { @VisibleForTesting static int getVersionFromString(String versionString) { if (versionString.startsWith("1.")) { if (versionString.length() >= 3 && Character.isDigit(versionString.charAt(2))) { return versionString.charAt(2) - '0'; } return 0; } int dotIndex = versionString.indexOf("."); try { if (dotIndex == -1) { return Integer.parseInt(versionString); } return Integer.parseInt(versionString.substring(0, versionString.indexOf("."))); } catch (NumberFormatException ex) { return 0; } } @VisibleForTesting  MavenProjectProperties(
      PluginDescriptor jibPluginDescriptor,
      MavenProject project,
      MavenSession session,
      Log log,
      TempDirectoryProvider tempDirectoryProvider,
      Supplier<List<JibMavenPluginExtension<?>>> extensionLoader); static MavenProjectProperties getForProject(
      PluginDescriptor jibPluginDescriptor,
      MavenProject project,
      MavenSession session,
      Log log,
      TempDirectoryProvider tempDirectoryProvider); @Nullable static String getProperty(
      String propertyName, @Nullable MavenProject project, @Nullable MavenSession session); @Override JibContainerBuilder createJibContainerBuilder(
      JavaContainerBuilder javaContainerBuilder, ContainerizingMode containerizingMode); @Override List<Path> getClassFiles(); @Override void waitForLoggingThread(); @Override void configureEventHandlers(Containerizer containerizer); @Override void log(LogEvent logEvent); @Override String getToolName(); @Override String getToolVersion(); @Override String getPluginName(); @Nullable @Override String getMainClassFromJarPlugin(); @Override Path getDefaultCacheDirectory(); @Override String getJarPluginName(); @Override boolean isWarProject(); @Override String getName(); @Override String getVersion(); @Override int getMajorJavaVersion(); @Override boolean isOffline(); @Override JibContainerBuilder runPluginExtensions(
      List<? extends ExtensionConfiguration> extensionConfigs,
      JibContainerBuilder jibContainerBuilder); static final String PLUGIN_NAME; static final String PLUGIN_KEY; }### Answer:
@Test public void testGetVersionFromString() { Assert.assertEquals(8, MavenProjectProperties.getVersionFromString("1.8")); Assert.assertEquals(8, MavenProjectProperties.getVersionFromString("1.8.0_123")); Assert.assertEquals(11, MavenProjectProperties.getVersionFromString("11")); Assert.assertEquals(11, MavenProjectProperties.getVersionFromString("11.0.1")); Assert.assertEquals(0, MavenProjectProperties.getVersionFromString("asdfasdf")); Assert.assertEquals(0, MavenProjectProperties.getVersionFromString("")); Assert.assertEquals(0, MavenProjectProperties.getVersionFromString("11abc")); Assert.assertEquals(0, MavenProjectProperties.getVersionFromString("1.abc")); }