Implementing find middle element of singly linked list without using 2 pointers
It could be a little easier to read like this:

public Object findMiddleElement() {
    Node node = head;

    if(hasMiddleElement()) {
        for(int i = 0; i &lt; size / 2; i++) {
            node = node.getNext();
        }
    } else {
        System.out.println("there is no middle element");
        node.setElement(null);
    }
    return node.getElement();
}

private boolean hasMiddleElement() {
   return size % 2 == 1;
}


This works if size is set in the class.