class RemitSyncExecutor implements Handler.Callback {

    public boolean handleMessage(Message msg) {
        List<Integer> idList;
        int id;
        switch (msg.what) {
            case WHAT_REMOVE_INFO:
                id = msg.arg1;
                freeToDBIdList.remove(id);
                this.agent.removeInfo(id);
                Util.d(TAG, "remove info " + id);
                break;
            case WHAT_REMOVE_FREE_BUNCH_ID:
                // remove bunch free-ids
                idList = (List<Integer>) msg.obj;
                freeToDBIdList.removeAll(idList);
                Util.d(TAG, "remove free bunch ids " + idList);
                break;
            case WHAT_REMOVE_FREE_ID:
                // remove free-id
                id = msg.arg1;
                freeToDBIdList.remove(id);
                Util.d(TAG, "remove free bunch id " + id);
                break;
            case WHAT_SYNC_BUNCH_ID:
                // sync bunch id
                idList = (List<Integer>) msg.obj;
                try {
                    this.agent.syncCacheToDB(idList);
                    freeToDBIdList.addAll(idList);
                    Util.d(TAG, "sync bunch info with ids: " + idList);
                } catch (IOException e) {
                    Util.w(TAG, "sync info to db failed for ids: " + idList);
                }
                break;
            default:
                // sync id
                id = msg.what;
                try {
                    this.agent.syncCacheToDB(id);
                    freeToDBIdList.add(id);
                    Util.d(TAG, "sync info with id: " + id);
                } catch (IOException e) {
                    Util.w(TAG, "sync cache to db failed for id: " + id);
                }
                break;
        }
        return true;
    }

      RemitSyncExecutor(@NonNull RemitAgent agent);
      RemitSyncExecutor(@NonNull RemitAgent agent, @Nullable Handler handler,
                      @NonNull Set<Integer> freeToDBIdList);

}