// Path: server/src/main/java/com/amplify/honeydew_server/Action.java
// public abstract class Action {
//     protected final UiDevice uiDevice;
// 
//     protected final String TAG = getClass().getSimpleName();
// 
//     public Action(UiDevice uiDevice) {
//         this.uiDevice = uiDevice;
//     }
// 
//     public abstract Result execute(Map<String, Object> arguments) throws UiObjectNotFoundException;
// 
//     public String name() {
//         return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, getClass().getSimpleName());
//     }
// 
//     protected UiDevice getUiDevice() {
//         return uiDevice;
//     }
// 
//     private long getTimeoutInMs(Map<String, Object> arguments){
//         return Integer.parseInt((String) arguments.get("timeout")) * 1000;
//     }
// 
//     protected boolean isUiObjectAvailable(UiObject uiObject, Map<String, Object> arguments){
//        return uiObject.waitForExists(getTimeoutInMs(arguments));
//     }
// 
//     protected boolean isUiObjectGone(UiObject uiObject, Map<String, Object> arguments){
//         return uiObject.waitUntilGone(getTimeoutInMs(arguments));
//     }
// 
//     protected UiObject getUiObject(Map<String, Object> arguments) {
//         ViewSelector viewSelector = getViewSelector(arguments);
//         return viewSelector.find();
//     }
// 
//     protected ViewSelector getViewSelector(Map<String, Object> arguments) {
//         ViewSelector viewSelector = new ViewSelector();
// 
//         Log.d(TAG, arguments.toString());
//         if (arguments.containsKey("type")) {
//             Log.d(TAG, String.format("Type %s", (String) arguments.get("type")));
//             viewSelector.withType((String) arguments.get("type"));
//         }
//         if (arguments.containsKey("text")) {
//             Log.d(TAG, String.format("Text %s", (String) arguments.get("text")));
//             viewSelector.withText((String) arguments.get("text"));
//         }
//         if (arguments.containsKey("description")) {
//             Log.d(TAG, String.format("Description %s", (String) arguments.get("description")));
//             viewSelector.withDescription((String) arguments.get("description"));
//         }
//         if (arguments.containsKey("regex")) {
//             Log.d(TAG, String.format("Regular Expression %s", (String) arguments.get("regex")));
//             viewSelector.withRegexMatch((String) arguments.get("regex"));
//         }
//         return viewSelector;
//     }
// 
//     public static class ViewSelector {
//         private UiSelector uiSelector = new UiSelector();
// 
//         public ViewSelector withType(String type) {
//             uiSelector = uiSelector.className("android.widget." + type);
//             return this;
//         }
// 
//         public ViewSelector withText(String text) {
//             uiSelector = uiSelector.textContains(text);
//             return this;
//         }
// 
//         public ViewSelector withDescription(String description) {
//             uiSelector = uiSelector.description(description);
//             return this;
//         }
// 
//         public ViewSelector withRegexMatch(String regexString) {
//             uiSelector = uiSelector.textMatches(regexString);
//             return this;
//         }
// 
//         public UiObject find() {
//             return new UiObject(uiSelector);
//         }
//     }
// }
// 
// Path: server/src/main/java/com/amplify/honeydew_server/Result.java
// public class Result {
//     public final boolean success;
//     public String description;
//     public String errorMessage;
//     public String stackTrace;
// 
//     public static Result OK = new Result();
//     public static Result FAILURE = new Result(false);
// 
//     public Result() {
//         this(true);
//     }
// 
//     public Result(boolean success) {
//         this(success, success ? "Success!" : "Failure.");
//     }
// 
//     public Result(boolean success, String description) {
//         this.success = success;
//         this.description = description;
//     }
// 
//     public Result(String errorMessage, Throwable exception) {
//         this(errorMessage);
//         this.stackTrace = ExceptionUtils.getFullStackTrace(exception);
//     }
// 
//     public Result(String errorMessage) {
//         this.success = false;
//         this.errorMessage = errorMessage;
//     }
// }


import android.util.Log;
import com.amplify.honeydew_server.Action;
import com.amplify.honeydew_server.Result;
import com.android.uiautomator.core.UiCollection;
import com.android.uiautomator.core.UiDevice;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.core.UiSelector;
import java.util.Map;
package com.amplify.honeydew_server.actions;



public abstract class AbstractChildCountAction extends Action {
    public AbstractChildCountAction(UiDevice uiDevice) {
        super(uiDevice);
    }

    protected abstract boolean isTrue(int childCount, int count);

    @Override
// Path: server/src/main/java/com/amplify/honeydew_server/Action.java
// public abstract class Action {
//     protected final UiDevice uiDevice;
// 
//     protected final String TAG = getClass().getSimpleName();
// 
//     public Action(UiDevice uiDevice) {
//         this.uiDevice = uiDevice;
//     }
// 
//     public abstract Result execute(Map<String, Object> arguments) throws UiObjectNotFoundException;
// 
//     public String name() {
//         return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, getClass().getSimpleName());
//     }
// 
//     protected UiDevice getUiDevice() {
//         return uiDevice;
//     }
// 
//     private long getTimeoutInMs(Map<String, Object> arguments){
//         return Integer.parseInt((String) arguments.get("timeout")) * 1000;
//     }
// 
//     protected boolean isUiObjectAvailable(UiObject uiObject, Map<String, Object> arguments){
//        return uiObject.waitForExists(getTimeoutInMs(arguments));
//     }
// 
//     protected boolean isUiObjectGone(UiObject uiObject, Map<String, Object> arguments){
//         return uiObject.waitUntilGone(getTimeoutInMs(arguments));
//     }
// 
//     protected UiObject getUiObject(Map<String, Object> arguments) {
//         ViewSelector viewSelector = getViewSelector(arguments);
//         return viewSelector.find();
//     }
// 
//     protected ViewSelector getViewSelector(Map<String, Object> arguments) {
//         ViewSelector viewSelector = new ViewSelector();
// 
//         Log.d(TAG, arguments.toString());
//         if (arguments.containsKey("type")) {
//             Log.d(TAG, String.format("Type %s", (String) arguments.get("type")));
//             viewSelector.withType((String) arguments.get("type"));
//         }
//         if (arguments.containsKey("text")) {
//             Log.d(TAG, String.format("Text %s", (String) arguments.get("text")));
//             viewSelector.withText((String) arguments.get("text"));
//         }
//         if (arguments.containsKey("description")) {
//             Log.d(TAG, String.format("Description %s", (String) arguments.get("description")));
//             viewSelector.withDescription((String) arguments.get("description"));
//         }
//         if (arguments.containsKey("regex")) {
//             Log.d(TAG, String.format("Regular Expression %s", (String) arguments.get("regex")));
//             viewSelector.withRegexMatch((String) arguments.get("regex"));
//         }
//         return viewSelector;
//     }
// 
//     public static class ViewSelector {
//         private UiSelector uiSelector = new UiSelector();
// 
//         public ViewSelector withType(String type) {
//             uiSelector = uiSelector.className("android.widget." + type);
//             return this;
//         }
// 
//         public ViewSelector withText(String text) {
//             uiSelector = uiSelector.textContains(text);
//             return this;
//         }
// 
//         public ViewSelector withDescription(String description) {
//             uiSelector = uiSelector.description(description);
//             return this;
//         }
// 
//         public ViewSelector withRegexMatch(String regexString) {
//             uiSelector = uiSelector.textMatches(regexString);
//             return this;
//         }
// 
//         public UiObject find() {
//             return new UiObject(uiSelector);
//         }
//     }
// }
// 
// Path: server/src/main/java/com/amplify/honeydew_server/Result.java
// public class Result {
//     public final boolean success;
//     public String description;
//     public String errorMessage;
//     public String stackTrace;
// 
//     public static Result OK = new Result();
//     public static Result FAILURE = new Result(false);
// 
//     public Result() {
//         this(true);
//     }
// 
//     public Result(boolean success) {
//         this(success, success ? "Success!" : "Failure.");
//     }
// 
//     public Result(boolean success, String description) {
//         this.success = success;
//         this.description = description;
//     }
// 
//     public Result(String errorMessage, Throwable exception) {
//         this(errorMessage);
//         this.stackTrace = ExceptionUtils.getFullStackTrace(exception);
//     }
// 
//     public Result(String errorMessage) {
//         this.success = false;
//         this.errorMessage = errorMessage;
//     }
// }


// Path: server/src/main/java/com/amplify/honeydew_server/actions/AbstractChildCountAction.java
import android.util.Log;
import com.amplify.honeydew_server.Action;
import com.amplify.honeydew_server.Result;
import com.android.uiautomator.core.UiCollection;
import com.android.uiautomator.core.UiDevice;
import com.android.uiautomator.core.UiObjectNotFoundException;
import com.android.uiautomator.core.UiSelector;
import java.util.Map;

package com.amplify.honeydew_server.actions;



public abstract class AbstractChildCountAction extends Action {
    public AbstractChildCountAction(UiDevice uiDevice) {
        super(uiDevice);
    }

    protected abstract boolean isTrue(int childCount, int count);

    @Override
    public final Result execute(Map<String, Object> arguments) throws UiObjectNotFoundException {