All languages have pitfalls. Including the author's beloved Java. For example:
String x = "foo";
String y = "foo";
// Appears to work but compares references
System.out.println(x[0] == x[1]);
There's no substitute for knowing your tools well.