public void addFunctionListener(SAFunctionListener functionListener) {
        try {
            if (this.mFunctionListener == null) {
                mFunctionListener = new ArrayList<>();
            }
            if (functionListener != null && !mFunctionListener.contains(functionListener)) {
                mFunctionListener.add(functionListener);
            }
            JSONObject jsonObject = cacheData;
            if (jsonObject != null) {
                call("trackEvent", jsonObject);
            }
        } catch (Exception ex) {
            SALog.printStackTrace(ex);
        }
    }
@Test
    public void addFunctionListener() {
        SensorsDataAPI sensorsDataAPI = SAHelper.initSensors(mApplication);
        sensorsDataAPI.addFunctionListener(new SAFunctionListener() {
            @Override
            public void call(String function, JSONObject args) {
                Assert.assertEquals("trackEvent", function);
            }
        });
        sensorsDataAPI.track("AppTest");
    }