To update or to delete? That is the Query
Depending on your use case, I recommend two options. Both of them are based on a separate function for checking things....

At its simplest, have a function:

private static final boolean needToDoSomething(String currentValue, String newValue) {
    return currentValue == null &amp;&amp; newValue != null || currentValue != null &amp;&amp; newValue == null;
}


Then you can just have:

if (needToDoSomething(currentValue, newValue)) {
    ....
}


If you need to do something more special than just the 'needs modification' test, for example, you need to distinguish inside the if block between these conditions, then I would recommend an Enum with a static method, for example:

public enum EditState {
    ADDED, DELETED, MODIFIED, UNCHANGED;

    public static getState(String currentValue, String newValue) {
        if (currentValue == newValue) {
            // this covers null == null too
            return UNCHANGED;
        }
        if (currentValue != null &amp;&amp; newValue == null) {
            return DELETED;
        }
        if (newValue != null &amp;&amp; currentValue == null) {
            return ADDED;
        }
        return currentValue.equals(newValue) ? UNCHANGED : MODIFIED;
    }


    public boolean isStateChanging() {
        return this != UNCHANGED;
    }
}


Then, with this Enum class, you can be more specific:

EditState state = EditState.getState(currentValue, newValue);

switch (state) {
    case UNCHANGED :
        .....
    case DELETED :
        .....
    ....
}