some improvements in java backend strategy rule iterators

While trying to debug something, I realized that rewrite engine is trying to iterate through rewrite rules, but strategy is just returning empty list of rules. I made some simplifications in the iterator methods to prevent this. This should come with a minor performance improvement. (no more iterating through empty lists)

Note that I'm just learning Java backend, so I may have done something wrong. @yilongli @dwightguth please review.


In the past, I found that sometimes this method return duplicate rules. But I have never tried to identify the root cause. Can you make sure this is no longer the case? Actually, I don't really like returning a collection of rules in the first place.