public boolean existConnection(int id) {
        ListElement current = head;
        while (current != null) {
            if (current.getId() == id) {
                return true;
            }
            current = current.getNext();
        }
        return false;
    }