/**
   * Test API calls for listing and removing group elements.
   *
   * @param group
   * @throws SiteWhereException
   */
  protected void testListAndRemoveNetworkElements(IDeviceGroup group) throws SiteWhereException {
    ISearchResults<IDeviceGroupElement> groupElements =
        getDeviceManagement().listDeviceGroupElements(group.getToken(), new SearchCriteria(0, 10));
    LOGGER.info("Matched " + groupElements.getResults().size() + " group elements.");

    List<IDeviceGroupElementCreateRequest> delete =
        new ArrayList<IDeviceGroupElementCreateRequest>();
    for (IDeviceGroupElement current : groupElements.getResults()) {
      DeviceGroupElementCreateRequest delElm = new DeviceGroupElementCreateRequest();
      delElm.setType(current.getType());
      delElm.setElementId(current.getElementId());
      delete.add(delElm);
    }
    List<IDeviceGroupElement> deleted =
        getDeviceManagement().removeDeviceGroupElements(group.getToken(), delete);
    LOGGER.info("Deleted " + deleted.size() + " group elements.");

    groupElements =
        getDeviceManagement().listDeviceGroupElements(group.getToken(), new SearchCriteria(0, 100));
    LOGGER.info("Remaining was " + groupElements.getResults().size() + " group elements.");
  }