Cycle detection in undirected graphs with recursive DFS
The code looks clean and organized, but there is an issue with the implementation.
Undirected graph
Consider an undirected graph A - B:

B is neighbor of A
A is neighbor of B

Using the current implementation I would create the graph like this:
Node a = new Node(1);
Node b = new Node(2);

a.add(b);
b.add(a);

Such graph is not cyclic, but the method hasCycleDfs returns true.

unlike other implementations I found on the internet, I used just one
set for the visited nodes (instead of having a set for the visited
nodes and another one for the ancestors)

The reason for the set of ancestors is to handle this case.
Testing

Is good practice to have one method for test case, instead of a single method with all the tests. It will help you pinpoint the failing test quicker without having to look at the code.
Once you have multiple @Test methods, you can clean the state in a method annotated with @Before (@BeforeEach in Junit5) or simply recreate the graph from scratch every time.

Minor improvements

The methods of Node are public unlike the class and instance variables. Use the access modifiers consistently.
In a non‐academic context, the method hasCycleDfs should be private as it needs to be called with and empty set:
boolean hasCycleDfs(Node current) {
    return hasCycleDfs(Node current, new HashSet&lt;&gt;());
}
private boolean hasCycleDfs(Node current, Set&lt;Node&gt; visited) {
    //...
}



Rewrite
Actually, there is no need for a set of ancestors, a pointer to the parent is enough:
boolean hasCycleDfs(Node current, Set&lt;Node&gt; visited, Node parent) {
    visited.add(current);
    for (Node neighbour : current.neighbors) {
        if (!visited.contains(neighbour)) {
            if (hasCycleDfs(neighbour, visited, current)) {
                return true;
            }
        } else if (!neighbour.equals(parent)) {
            // If the node is visited and not parent of 
            // the current node, then there is a cycle
            return true;
        }
    }
    return false;
}

And you can use it like:
hasCycleDfs(n1, new HashSet&lt;&gt;(), null);