A tiny optimisation would be:
Integer n = null;
if (newOccurrenceCountOverThreshold != null) {
    int thresholdAdjustment = ...
}