static ObjectName newObjectName(String name) {
    try {
      return new ObjectName(name);
    } catch (MalformedObjectNameException e) {
      String msg = "Illegal ObjectName: " + name;
      throw new CacheException(msg, e);
    }
  }
@Test
  public void newObjectName_malformed() {
    assertThrows(CacheException.class, () -> JmxRegistration.newObjectName("a=b"));
  }