public void visit(CasaConnection connection) { // Ensure the connection is not already deleted. String state = connection.getState(); if (connection.isInDocumentModel() && !CasaConnectionState.DELETED.getState().equals(state)) { mModel.removeConnection(connection); } }