public static String getBaseName(String versionName) throws IOException {
    Objects.requireNonNull(versionName, "VersionName cannot be null");
    int div = versionName.lastIndexOf('@');
    if (div == -1) {
      throw new IOException("No version in key path " + versionName);
    }
    return versionName.substring(0, div);
  }
@Test
  public void testParseVersionName() throws Exception {
    assertEquals("/a/b", KeyProvider.getBaseName("/a/b@3"));
    assertEquals("/aaa", KeyProvider.getBaseName("/aaa@112"));
    try {
      KeyProvider.getBaseName("no-slashes");
      assertTrue("should have thrown", false);
    } catch (IOException e) {
      assertTrue(true);
    }
    intercept(NullPointerException.class, () ->
        KeyProvider.getBaseName(null));
  }