In Java, the primitive type double uses the IEEE-754 semantics and java.lang.Double uses the bits by bits comparison semantics [1] so List<Double>.remove() works correctly.
[1] https://docs.oracle.com/en/java/javase/19/docs/api/java.base...
[1] https://docs.oracle.com/en/java/javase/19/docs/api/java.base...
What will help you is that `clear()` is part of `Java.until.Collection` so just about every container has it.