shadows/framework/src/main/java/org/robolectric/shadows/ShadowUserManager.java
public void setUserState(UserHandle handle, UserState state) {
    userState.put(handle.getIdentifier(), state);
  }
public void setUserState(UserHandle handle, UserState state) {
    userState.put(handle.getIdentifier(), state);
  }
Sets the current state for a given user, see {@link UserManager#isUserRunning(UserHandle)}
and {@link UserManager#isUserRunningOrStopping(UserHandle)}