@Test
public void hasMultipleUsers() throws Exception {

 String[] pmOutput = new String[]{
    "Users:",
    "              UserInfo{0:User0:13} running",
    "              UserInfo{11:Sample Managed Profile:30} running"
  };
  IDevice device = createListUsersMockDevice(pmOutput);
  assertTrue(MultiUserUtils.hasMultipleUsers(device, 200, TimeUnit.MILLISECONDS, false));
  pmOutput = new String[]{
    "Users:",
    "              UserInfo{0:User0:13} running"
  };
  device = createListUsersMockDevice(pmOutput);
  assertFalse(MultiUserUtils.hasMultipleUsers(device, 200, TimeUnit.MILLISECONDS, true));
  // Some versions of the Android (e.g. emulator running x86, API 19) have this additional error message
  pmOutput = new String[]{
    "WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.",
    "Users:",
    "\tUserInfo{0:Owner:13}"
  };
  device = createListUsersMockDevice(pmOutput);
  assertFalse(MultiUserUtils.hasMultipleUsers(device, 200, TimeUnit.MILLISECONDS, true));
}