@Test public void testTakeUnavailableUser() { PlusAnonymousConcurrentUserDataModel instance = getTestableWithoutDelegateData(1); instance.takeAvailableUser(); assertNull(instance.takeAvailableUser()); }
public Long takeAvailableUser() { Long takenUserID = usersPool.poll(); if (takenUserID != null) { tempPrefs.put(takenUserID, new GenericUserPreferenceArray(0)); return takenUserID; } return null; }
PlusAnonymousConcurrentUserDataModel extends PlusAnonymousUserDataModel { public Long takeAvailableUser() { Long takenUserID = usersPool.poll(); if (takenUserID != null) { tempPrefs.put(takenUserID, new GenericUserPreferenceArray(0)); return takenUserID; } return null; } }
PlusAnonymousConcurrentUserDataModel extends PlusAnonymousUserDataModel { public Long takeAvailableUser() { Long takenUserID = usersPool.poll(); if (takenUserID != null) { tempPrefs.put(takenUserID, new GenericUserPreferenceArray(0)); return takenUserID; } return null; } PlusAnonymousConcurrentUserDataModel(DataModel delegate, int maxConcurrentUsers); }
PlusAnonymousConcurrentUserDataModel extends PlusAnonymousUserDataModel { public Long takeAvailableUser() { Long takenUserID = usersPool.poll(); if (takenUserID != null) { tempPrefs.put(takenUserID, new GenericUserPreferenceArray(0)); return takenUserID; } return null; } PlusAnonymousConcurrentUserDataModel(DataModel delegate, int maxConcurrentUsers); Long takeAvailableUser(); boolean releaseUser(Long userID); void setTempPrefs(PreferenceArray prefs, long anonymousUserID); void clearTempPrefs(long anonymousUserID); @Override LongPrimitiveIterator getUserIDs(); @Override PreferenceArray getPreferencesFromUser(long userID); @Override FastIDSet getItemIDsFromUser(long userID); @Override PreferenceArray getPreferencesForItem(long itemID); @Override Float getPreferenceValue(long userID, long itemID); @Override Long getPreferenceTime(long userID, long itemID); @Override int getNumUsers(); @Override int getNumUsersWithPreferenceFor(long itemID); @Override int getNumUsersWithPreferenceFor(long itemID1, long itemID2); @Override void setPreference(long userID, long itemID, float value); @Override void removePreference(long userID, long itemID); }
PlusAnonymousConcurrentUserDataModel extends PlusAnonymousUserDataModel { public Long takeAvailableUser() { Long takenUserID = usersPool.poll(); if (takenUserID != null) { tempPrefs.put(takenUserID, new GenericUserPreferenceArray(0)); return takenUserID; } return null; } PlusAnonymousConcurrentUserDataModel(DataModel delegate, int maxConcurrentUsers); Long takeAvailableUser(); boolean releaseUser(Long userID); void setTempPrefs(PreferenceArray prefs, long anonymousUserID); void clearTempPrefs(long anonymousUserID); @Override LongPrimitiveIterator getUserIDs(); @Override PreferenceArray getPreferencesFromUser(long userID); @Override FastIDSet getItemIDsFromUser(long userID); @Override PreferenceArray getPreferencesForItem(long itemID); @Override Float getPreferenceValue(long userID, long itemID); @Override Long getPreferenceTime(long userID, long itemID); @Override int getNumUsers(); @Override int getNumUsersWithPreferenceFor(long itemID); @Override int getNumUsersWithPreferenceFor(long itemID1, long itemID2); @Override void setPreference(long userID, long itemID, float value); @Override void removePreference(long userID, long itemID);  }