title: How to gracefully end test client
body: <p>I have a simple cumulocity test client. The code runs fine but the jvm does not stop when the code finishes.
  Some threads are still running: MultiThreadedHttpConnectionManager.</p>
  
  <p>How to gracefully shutdown the open connections allocated by: </p>
  
  <pre><code>InventoryApi inventory = platform.getInventoryApi() ?
  </code></pre>
  
  <p>_</p>
  
  <pre><code>...
  platform = new PlatformImpl(App.C8Y_URL, new CumulocityCredentials(App.C8Y_USER, App.C8Y_PWD));
  InventoryApi inventory = platform.getInventoryApi();
  
  GId testId = new GId("123456");
  ManagedObjectRepresentation testDevice = inventory.get(testId);
  MeasurementApi mApi = platform.getMeasurementApi();
  
  MeasurementRepresentation measurement = new MeasurementRepresentation();
  measurement.setType("c8y_SampleRate");
  measurement.setSource(testDevice);
  
  DateTime time = new DateTime();
  System.out.println("time " + time.toString());
  measurement.setDateTime(time);
  Map&lt;String, Object&gt; flowRateFragment = App.createFlowRateFragment(new BigDecimal(20.5));
  measurement.set(flowRateFragment, "c8y_SampleRate");
  
  MeasurementRepresentation measurementCreation = mApi.create(measurement);
  ...
  </code></pre>