Put a tune into the book. If exists, replace tune with the same reference
number and returns true. If doesn't exist, add it and return false.

@return true if it replaced an existing tune, false otherwise
776791
public boolean putTune(Tune tune) {
		boolean ret = containsTune(tune);
		tune.getTuneInfos().setBookInfos(getBookInfos());
		tune.getInstructions().addAll(0, getInstructions());
		m_tunes.put(tune.getReferenceNumber(), tune);
		return ret;
	}
1333675
public boolean hasChordNames() {
		MusicElement currentScoreEl;
		Iterator it = iterator();
		while (it.hasNext()) {
			currentScoreEl = (MusicElement) it.next();
			if (currentScoreEl instanceof NoteAbstract) {
				if (((NoteAbstract) currentScoreEl).getChordName() != null)
					return true;
			}
		}
		return false;
	}
607522
public boolean putReference(K key, ServiceReference<V> reference) {
        if (key == null || reference == null)
            return false;

        ConcurrentServiceReferenceSet<V> csrs = elementMap.get(key);
        if (csrs == null) {
            // No set for this key: allocate a new set that shares a context reference.
            ConcurrentServiceReferenceSet<V> newSet = new ConcurrentServiceReferenceSet<V>(referenceName, contextRef);

            // Try to add the set to the map: the value returned will be non-null if something else beat us there.
            ConcurrentServiceReferenceSet<V> currentSet = elementMap.putIfAbsent(key, newSet);
            csrs = (currentSet == null) ? newSet : currentSet;
        }

        return csrs.addReference(reference);
    }
507094
public boolean onAdd()
    {
        Record record = this.getMainRecord();
        if (record == null)
            return false;

        try {
            if (record.isModified(false))
            {
                if (record.getEditMode() == Constants.EDIT_IN_PROGRESS)
                    record.set();
                else if (record.getEditMode() == Constants.EDIT_ADD)
                    record.add();
            }
            record.addNew();
            this.clearStatusText();
        } catch(DBException ex) {
            this.displayError(ex);
            return false;
        }
        return true;
    }
549278
public boolean replace    ( TypeK  key, TypeV  oldValue, TypeV newValue ) {
    return putIfMatch( key, newValue, oldValue ) == oldValue;
  }
1338543
public boolean tryRef(T t)
    {
        Ref<T> ref = t.tryRef();
        if (ref == null)
            return false;
        ref = references.put(t, ref);
        if (ref != null)
            ref.release(); // release dup
        return true;
    }
897802
public synchronized boolean addPreInvalidationListener(PreInvalidationListener listener) {
        if (bEnableListener && listener != null) {
            if (eventSource.getPreInvalidationListenerCount() > 0 && tc.isDebugEnabled()) {
                Tr.debug(tc, "addPreInvalidationListener() cacheName=" + this.cacheName + " one already exists. Overwriting old listener.");
            }
            eventSource.addListener(listener);
            return true;
        }
        return false;
    }
2965
public boolean put(final int key) {
		if (isFull()) { // full
			resizeArray();
		}
		int slot = findSlotByKey(key);
		if (slot >= 0) {
			if (log.isDebugEnabled()) {
				log.debug("key already exists: " + key);
			}
			return false; // key already exist
		}
		slot = ((-slot) - 1);
		return addSlot(slot, key);
	}
311549
def add_song(self, new_song, verbose=True):
        """"""

        if any([song.title == new_song.title for song in self._songs]):
            if verbose:
                print('{s} already in {a}, not adding song.'.format(s=new_song.title,
                                                                    a=self.name))
            return 1  # Failure
        if new_song.artist == self.name:
            self._songs.append(new_song)
            self._num_songs += 1
            return 0  # Success
        if verbose:
            print("Can't add song by {b}, artist must be {a}.".format(b=new_song.artist,
                                                                      a=self.name))
        return 1
501109
public boolean replaceIn(final StringBuffer source) {
        if (source == null) {
            return false;
        }
        return replaceIn(source, 0, source.length());
    }
696740
public boolean onRefresh()
    {
        Record record = this.getMainRecord();
        if (record == null)
            return false;

        try
        {
            if (record.getEditMode() == Constants.EDIT_IN_PROGRESS)
            {   // If they're adding, can't delete nothing!
                if (record.isRefreshedRecord())
                    return this.onDelete();
                Object bookmark = record.getHandle(DBConstants.BOOKMARK_HANDLE);
                record.setHandle(bookmark, DBConstants.BOOKMARK_HANDLE);
            }
            if (record.getEditMode() == Constants.EDIT_ADD)
                record.addNew();
            this.clearStatusText();
        } catch (DBException ex) {
            this.displayError(ex);
            return false;
        }
        return true;
    }
989055
public boolean recordConstancy() {
    if (!currentInfo.hasConstAnnotation()) {
      currentInfo.setConstant(true);
      populated = true;
      return true;
    } else {
      return false;
    }
  }
980983
public boolean addIfAbsent(E e) {
        final ReentrantLock lock = this.lock;
        lock.lock();
        try {
            // Copy while checking if already present.
            // This wins in the most common case where it is not present
            Object[] elements = getArray();
            int len = elements.length;
            Object[] newElements = new Object[len + 1];
            for (int i = 0; i < len; ++i) {
                if (eq(e, elements[i]))
                    return false; // exit, throwing away copy
                else
                    newElements[i] = elements[i];
            }
            newElements[len] = e;
            setArray(newElements);
            return true;
        } finally {
            lock.unlock();
        }
    }
733521
public boolean redo() {
    LOGGER.trace("redo, before, size: " + changes.size() + " pos: " + position.get()
        + " validPos: " + validPosition.get());
    Change nextChange = next();
    if (nextChange != null) {
      doWithoutListeners(nextChange.getSetting(), nextChange::redo);
      LOGGER.trace("redo, after, size: " + changes.size() + " pos: " + position.get()
          + " validPos: " + validPosition.get());
      return true;
    }
    return false;
  }
112486
public synchronized boolean addUnique(int key, int value) {

        if (count == capacity) {
            if (fixedSize) {
                return false;
            } else {
                doubleCapacity();
            }
        }

        if (!sorted) {
            fastQuickSort();
        }

        targetSearchValue = sortOnValues ? value
                                         : key;

        int i = binaryEmptySlotSearch();

        if (i == -1) {
            return false;
        }

        hasChanged = true;

        if (count != i) {
            moveRows(i, i + 1, count - i);
        }

        keys[i]   = key;
        values[i] = value;

        count++;

        return true;
    }
105680
public boolean equalsTo(Object o)
    {
        if(o == null || !(o instanceof Reference))
        {
            return false;
        }
        
        Reference refCompared = (Reference)o;
        if(!StringUtil.isEquals(sections, refCompared.sections)) return false;
        if(systemUnderTest == null || !systemUnderTest.equalsTo(refCompared.systemUnderTest)) return false;
        if(requirement == null || !requirement.equalsTo(refCompared.requirement)) return false;
        if(specification == null || !specification.equalsTo(refCompared.specification)) return false;
        
        return true;
    }
471350
private void addBook(String isbn, String title, String synopsis, int quantity) {
        Book book = new Book();
        book.setIsbn(isbn);
        book.setTitle(title);
        book.setSynopsis(synopsis);
        isbns_to_books.put(isbn, book);
        isbns_to_quantities.put(isbn, quantity);
    }