How to make business logic code maintainable when working with multiple states? I am developing a UI Application for a very simple phone app, the UI is based entirely on the state of Call in a container provided to me by a third party library. 

Below is a sample Call object that I am working with;

public class Call {
    private boolean isTannoyCall;
    private long callStart;
    private int callId;
    private int callState;
    private CallDirection mCallDirection = CallDirection.OUTGOING;
    private int mediaStatus;
    private boolean mediaHasVideoStream;
    private long connectStart;
        private int lastStatusCode;
        private boolean callIsMuted;
        private boolean callIsInConference;

    //removed getters and setters
}


A populated call object is then passed around my application, in various places I have to carry out business logic to check if I should be carrying out an action etc. Below is an example of an event listener method for new calls within the app.

public void update() {
    int activeCallCount = 0;
    int incomingCallCount = 0;

    for (Call call : container.getCalls()) {

        boolean isIncomingDirection = call.getCallDirection() == CallDirection.INCOMING;

        boolean isIncomingCall = isIncomingDirection
                &amp;&amp; call.getCallState() == CallState.INCOMING &amp;&amp; !call.isTannoyCall();

        boolean isActiveCall = call.isActive()
                &amp;&amp; call.getCallState() != call.InvState.INCOMING &amp;&amp; !call.isTannoyCall();

        if (isIncomingCall) {
            incomingCallCount++;
        } else if (isActiveCall) {
            activeCallCount++;
        }

        boolean isMissedCall = isIncomingDirection
                &amp;&amp; call.getCallState() == call.InvState.DISCONNECTED
                &amp;&amp; call.getCallStart() == 0
                &amp;&amp; !call.isTannoyCall();

        if (isMissedCall) {
            missedCallManager.increment();
        }
    }
    incomingCallUpdate(incomingCallCount);
    activeCallUpdate(activeCallCount);
}


In areas of the application where I need to do a lot of boolean based checks, like sample 1. How can I do this whilst keeping the code maintainable?  As every time I need to add a new condition (e.g. the latest "don't update if tannoy call"), I have to modify the appropriate if statements.
It seems data/feature envy. Move the boolean conditions to the Call object:

public class Call {
    ...

    public boolean isIncomingDirection()
        return callDirection == CallDirection.INCOMING;
    }

    public boolean isIncomingCall() {
        return isIncomingDirection()
            &amp;&amp; callState == CallState.INCOMING &amp;&amp; !isTannoyCall;
    }

    public boolean isActiveCall() {
        return isActive()
                &amp;&amp; callState != InvState.INCOMING &amp;&amp; !isTannoyCall;
    }

    public boolean isMissedCall() {
        return isIncomingDirection()
                &amp;&amp; callState == InvState.DISCONNECTED
                &amp;&amp; callStart == 0
                &amp;&amp; !isTannoyCall;
    }       
}


See also: Clean Code by Robert C. Martin, G14: Feature Envy