class DefaultCommunicationService implements CommunicationService {

    public Direction computeNextDirection(Direction directionToRemove) {
        if (directionToRemove == null) {
            return Direction.BOTH;
        }

        if (directionToRemove.equals(Direction.INCOMING)) {
            return Direction.OUTGOING;
        }

        if (directionToRemove.equals(Direction.OUTGOING)) {
            return Direction.INCOMING;
        }
        return null;
    }

}