Source:
<code><START> public void update(final org.apache.datasketches.theta.Sketch sketchIn, final S summary) { <END> final boolean firstCall = firstCall_; firstCall_ = false; if (sketchIn == null) { empty_ = true; thetaLong_ = Long.MAX_VALUE; hashTables_.clear(); return; } final long thetaLongIn = sketchIn.getThetaLong(); final int countIn = sketchIn.getRetainedEntries(); thetaLong_ = min(thetaLong_, thetaLongIn); empty_ |= (countIn == 0) && (thetaLongIn == Long.MAX_VALUE); if (countIn == 0) { hashTables_.clear(); return; } if (firstCall) { final org.apache.datasketches.theta.Sketch firstSketch = sketchIn; hashTables_.fromSketch(firstSketch, summary); } else { if (hashTables_.count_ == 0) { return; } final org.apache.datasketches.theta.Sketch nextSketch = sketchIn; final int maxMatchSize = min(hashTables_.count_, nextSketch.getRetainedEntries()); final long[] matchKeys = new long[maxMatchSize]; S[] matchSummaries = null; int matchCount = 0; final org.apache.datasketches.theta.HashIterator it = sketchIn.iterator(); while (it.next()) { final long key = it.get(); if (key >= thetaLong_) { continue; } final int index = hashSearch(hashTables_.keys_, hashTables_.lgTableSize_, key); if (index < 0) { continue; } final S mySummary = hashTables_.summaries_[index]; if (matchSummaries == null) { matchSummaries = (S[]) Array.newInstance(mySummary.getClass(), maxMatchSize); } matchKeys[matchCount] = key; matchSummaries[matchCount] = summarySetOps_.intersection(mySummary, (S)mySummary.copy()); matchCount++; } hashTables_.fromArrays(matchKeys, matchSummaries, matchCount); } }</code><technical_language>For unions, summary is checked for null. Is check necessary here, internal intersection summaries verify this</technical_language>

Target:
public void update(final org.apache.datasketches.theta.Sketch sketchIn, final S summary) { if (sketchIn == null) { throw new SketchesArgumentException("Sketch may not be null"); } if (summary == null) { throw new SketchesArgumentException("Summary cannot be null."); } final boolean firstCall = firstCall_; firstCall_ = false; final long thetaLongIn = sketchIn.getThetaLong(); final int countIn = sketchIn.getRetainedEntries(); thetaLong_ = min(thetaLong_, thetaLongIn); empty_ |= (countIn == 0) && (thetaLongIn == Long.MAX_VALUE); if (countIn == 0) { hashTables_.clear(); return; } if (firstCall) { final org.apache.datasketches.theta.Sketch firstSketch = sketchIn; hashTables_.fromSketch(firstSketch, summary); } else { if (hashTables_.count_ == 0) { return; } final org.apache.datasketches.theta.Sketch nextSketch = sketchIn; final int maxMatchSize = min(hashTables_.count_, nextSketch.getRetainedEntries()); final long[] matchKeys = new long[maxMatchSize]; S[] matchSummaries = null; int matchCount = 0; final org.apache.datasketches.theta.HashIterator it = sketchIn.iterator(); while (it.next()) { final long key = it.get(); if (key >= thetaLong_) { continue; } final int index = hashSearch(hashTables_.keys_, hashTables_.lgTableSize_, key); if (index < 0) { continue; } final S mySummary = hashTables_.summaries_[index]; if (matchSummaries == null) { matchSummaries = (S[]) Array.newInstance(mySummary.getClass(), maxMatchSize); } matchKeys[matchCount] = key; matchSummaries[matchCount] = summarySetOps_.intersection(mySummary, (S)mySummary.copy()); matchCount++; } hashTables_.fromArrays(matchKeys, matchSummaries, matchCount); } }