### Question:
Bmgr { public void run(String[] args) { if (args.length < 1) { showUsage(); return; } mArgs = args; mNextArg = 0; int userId = parseUserId(); String op = nextArg(); Slog.v(TAG, "Running " + op + " for user:" + userId); if (mBmgr == null) { System.err.println(BMGR_NOT_RUNNING_ERR); return; } if ("activate".equals(op)) { doActivateService(userId); return; } if ("activated".equals(op)) { doActivated(userId); return; } if (!isBackupActive(userId)) { return; } if ("enabled".equals(op)) { doEnabled(userId); return; } if ("enable".equals(op)) { doEnable(userId); return; } if ("run".equals(op)) { doRun(userId); return; } if ("backup".equals(op)) { doBackup(userId); return; } if ("init".equals(op)) { doInit(userId); return; } if ("list".equals(op)) { doList(userId); return; } if ("restore".equals(op)) { doRestore(userId); return; } if ("transport".equals(op)) { doTransport(userId); return; } if ("wipe".equals(op)) { doWipe(userId); return; } if ("fullbackup".equals(op)) { doFullTransportBackup(userId); return; } if ("backupnow".equals(op)) { doBackupNow(userId); return; } if ("cancel".equals(op)) { doCancel(userId); return; } if ("whitelist".equals(op)) { doPrintWhitelist(); return; } System.err.println("Unknown command"); showUsage(); } @VisibleForTesting  Bmgr(IBackupManager bmgr);   Bmgr(); static void main(String[] args); void run(String[] args); static final String TAG; }### Answer:
@Test public void testRun_whenUserNotSpecified_callsBackupManagerAsSystemUser() throws Exception { mBmgr.run(new String[] {"run"}); verify(mBackupManager).isBackupServiceActive(UserHandle.USER_SYSTEM); }
@Test public void testRun_whenUserSpecified_callsBackupManagerAsSpecifiedUser() throws Exception { mBmgr.run(new String[] {"--user", "10"}); verify(mBackupManager).isBackupServiceActive(10); }