This can be simplified to:

if (oldValue == null || !oldValue.equals(newValue)) {

}