Benchmarks: Use EnumSet for checking node state

Replace a big if block with an EnumSet.contains().