public ArrayList<String[]> getSuggestedTags(JsonJavaObject data) {
    // ArrayList that will contain the set of classifiers and scores
    ArrayList<String[]> tags = new ArrayList<String[]>();

    // The data is returned as JSON with a root element of 'images'
    JsonJavaArray images = data.getAsArray("images");
    if (images != null) {
      // For each image, there is a set of scores in the JSON
      JsonJavaArray classifiers = images.getAsObject(0).getAsArray("classifiers");

      if (classifiers != null) {
        JsonJavaArray classes = classifiers.getAsObject(0).getAsArray("classes");
        if (classes != null) {
          // From the scores, get the 'name' of the classifier and it's associated 'score'
          for (int i = 0; i < classes.size(); i++) {
            JsonJavaObject jsonObj = classes.getAsObject(i);
            String tagName = jsonObj.getAsString("class");
            double score = jsonObj.getAsDouble("score");

            // Filter out classifiers with a match < 90%
            // if (score > 0.90) {
            // Add the classifier name and score to the ArrayList
            String[] tagInfo = new String[2];
            tagInfo[0] = tagName;
            tagInfo[1] = "" + score;
            tags.add(tagInfo);
            // }
          }
        }
      }
    }
    return tags;
  }
 @Test
 public void testGetActivity() {
   JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
   JsonJavaObject json = previewPage.getJson();
   String activityNodeId = json.getAsString("getActivityNodeUuid");
   Assert.assertNotNull(activityNodeId);
 }
  @Test
  public void testUpdateSubscriberProfile() {
    try {
      registerCustomer();
      String subscriberId = addSubscriber();

      SubscriberManagementService subscriberManagement = getSubscriberManagementService();

      JsonEntity jsonEntity = subscriberManagement.getSubscriberById(subscriberId);
      Assert.assertNotNull("Unable to retrieve subscriber: " + subscriberId, jsonEntity);
      Assert.assertEquals(
          subscriberId, subscriberManagement.getSubscriberId(jsonEntity.getJsonObject()));

      JsonJavaObject rootObject = jsonEntity.getJsonObject();
      Assert.assertNotNull("Unable to retrieve subscriber: " + subscriberId, rootObject);

      System.out.println(rootObject);
      JsonJavaObject subscriberObject = rootObject.getAsObject("Subscriber");
      JsonJavaObject personObject = subscriberObject.getAsObject("Person");
      personObject.putString("GivenName", "Fred");
      personObject.putString("WorkPhone", "800-666-1234");

      subscriberManagement.updateSubscribeProfile(rootObject);

      jsonEntity = subscriberManagement.getSubscriberById(subscriberId);
      Assert.assertNotNull("Unable to retrieve subscriber: " + subscriberId, jsonEntity);
      Assert.assertEquals(
          subscriberId, subscriberManagement.getSubscriberId(jsonEntity.getJsonObject()));

      rootObject = jsonEntity.getJsonObject();
      Assert.assertNotNull("Unable to retrieve subscriber: " + subscriberId, subscriberObject);

      System.out.println(rootObject);
      subscriberObject = rootObject.getAsObject("Subscriber");
      personObject = subscriberObject.getAsObject("Person");
      Assert.assertEquals("Fred", personObject.getAsString("GivenName"));
      Assert.assertEquals("800-666-1234", personObject.getAsString("WorkPhone"));

    } catch (BssException be) {
      JsonJavaObject jsonObject = be.getResponseJson();
      System.out.println(jsonObject);
      Assert.fail("Error updating subscriber profile caused by: " + jsonObject);
    } catch (Exception e) {
      e.printStackTrace();
      Assert.fail("Error updating subscriber profile caused by: " + e.getMessage());
    }
  }
 @Test
 public void testGetActivityMember() {
   JavaScriptPreviewPage previewPage = executeSnippet(SNIPPET_ID);
   JsonJavaObject json = previewPage.getJson();
   Assert.assertEquals(json.getAsString("getUserId"), id);
 }