Logic bug. isHuangBullshit is returning true if any statement is true. You want the opposite.
Map<X, Boolean> is a Set, Use a set instead.
Don’t use Boolean if null is never a possibility, just use boolean. The same is true of all the boxes for primitives. It’s a huge performance penalty to use Integer when int works. Not so much with Boolean but the principle is the same. You are forcing whoever sees your method to question whether or not you are going to get a null out of that method.
Logic bug.
isHuangBullshitis returningtrueif anystatementistrue. You want the opposite.Map<X, Boolean>is aSet, Use a set instead.Don’t use
Booleanifnullis never a possibility, just useboolean. The same is true of all the boxes for primitives. It’s a huge performance penalty to useIntegerwhenintworks. Not so much withBooleanbut the principle is the same. You are forcing whoever sees your method to question whether or not you are going to get anullout of that method.The correct code should look like this:
The OP literally codified the Huang’s answer. It’s you interpreting it wrong.