return false; } if (firstNode.getData().equals(o)) { // se for o primeiro removeFromFront(); return true; } else if (lastNode.getData().equals(o)) { // se for o último removeFromBack(); return true; } // se for um nodo interno Node corrente = firstNode; // procura elemento Node anterior = firstNode; while (corrente != null && !corrente.getData().equals(o)) { anterior = corrente; corrente = corrente.getNext(); } if (corrente == null)// se não encontrou return false; else anterior.setNext(corrente.getNext()); return true; }