docs: @SuppressWarnings("unchecked")
    private static <T> T newInstance(Class<?> type) {
      try {
        return (T) type.newInstance();
      } catch (InstantiationException | IllegalAccessException e) {
        throw new ServiceException("Cannot instantiate service class " + type, e);
      }
    }