shadows/framework/src/main/java/org/robolectric/shadows/ShadowUserManager.java
@Deprecated
  public void setIsGuestUser(boolean isGuestUser) {
    UserInfo userInfo = getUserInfo(UserHandle.myUserId());
    if (isGuestUser) {
      userInfo.flags |= UserInfo.FLAG_GUEST;
    } else {
      userInfo.flags &= ~UserInfo.FLAG_GUEST;
    }
  }
@Deprecated
  public void setIsGuestUser(boolean isGuestUser) {
    UserInfo userInfo = getUserInfo(UserHandle.myUserId());
    if (isGuestUser) {
      userInfo.flags |= UserInfo.FLAG_GUEST;
    } else {
      userInfo.flags &= ~UserInfo.FLAG_GUEST;
    }
  }
Sets that the current user is the guest user; controls the return value of {@link
UserManager#isGuestUser()}.

@deprecated Use {@link ShadowUserManager#addUser(int, String, int)} to create a guest user
instead of changing default user flags.