I think the pedantic thing to say is that OP is correct.
$ jshell
| Welcome to JShell -- Version 20.0.2
| For an introduction type: /help intro
c
jshell> class Foo
...> {
...> public void foo(int i)
...> {
...> System.out.println(i);
...> }
...>
...> private int foo (int number)
...> {
...> return number >> 1;
...> }
...> }
| Error:
| method foo(int) is already defined in class Foo
| private int foo (int number)
| ^---------------------------...
jshell>
The two methods have the same signatures, and the JShell tool correctly refused to compile such crappy code
