code: public static void applyChange(IDatabase db, Change change) {
      if (isApplicable(change)) {
        ITextNode textNode = db.getTextNode(change.getKey());
  
        if (textNode != null) {
          // textNode would be null for TYPE_KEY_ADDITION
          String language = change.getLanguage();
          IValueNode valueNode = textNode.getValueNode(language);
          if (valueNode != null) {
            // valueNode would be null for TYPE_LANGUAGE_ADDITION
            valueNode.setStatus(change.getAcceptStatus());
            valueNode.setValue(change.getAcceptValue());
          }
  
          if (change.hasMasterLanguage()) {
            String masterLanguage = change.getMasterLanguage();
            IValueNode masterValueNode = textNode.getValueNode(masterLanguage);
  
            if (masterValueNode != null) {
              // masterValueNode would be null for TYPE_MASTER_LANGUAGE_ADDITION
              masterValueNode.setValue(change.getAcceptMasterValue());
            }
          }
        }
      }
    }
docs: Applies a change to a trema database. If the change is not to be
  accepted (<code>!change.isAccept()</code>, that is) or if the
  change is an addition (type <code>Change.TYPE_KEY_ADDITION</code>,
  <code>Change.TYPE_LANGUAGE_ADDITION</code> or
  <code>Change.TYPE_MASTER_LANGUAGE_ADDITION</code>) this
  method has <b>no</b> effect.
  <p>
  The the master value, the status and the value to be accepted
  (<code>change.getAcceptMasterValue()</code>,
  <code>change.getAcceptStatus()</code> and
  <code>change.getAcceptValue()</code>, that is) will be set for the
  corresponding key and language.
  @param db the database to apply the changes to
  @param change the change to be applied
  @see ChangesAnalyzer#isApplicable(Change)