Code example for ArrayList

Methods: add, contains

0
    addPreference(preference);
  } 
 
  @Implementation 
  public boolean addPreference(Preference preference) {
    if (preferenceList.contains(preference)) {
      return true; 
    } 
 
    // TODO currently punting on ordering logic 
    preferenceList.add(preference);
 
    return true; 
  } 
 
  @Implementation 
  public Preference getPreference(int index) {
    return preferenceList.get(index);
  } 
 
  @Implementation