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.


Duplicate rules are still happening, but it's not related with this method. Some rules are added multiple times to index table. As an example, when I compile this file:

```
module TEST
  syntax Sort ::= Int | Bool
  syntax KResult ::= Int | Bool
  syntax KItem ::= "test"
  rule test => isKResult(?S:Sort) ~> ?KR:KResult ==K ?S:Sort
endmodule
```

These rules are added to index table:


```
rule <generatedTop><k>'test(.KList) ~> _3:K</k>_0:Bag</generatedTop> => <generatedTop><k>isKResult(_1:Sort) ~> '_==K_(_2:KResult,, _1:Sort) ~> _3:K</k>_0:Bag</generatedTop> requires [] ensures [] [Location: (5,3,5,60), File: /home/omer/K/k_new_dist/k/issue696/test.k]
rule <generatedTop><k>'test(.KList) ~> _3:K</k>_0:Bag</generatedTop> => <generatedTop><k>isKResult(_1:Sort) ~> '_==K_(_2:KResult,, _1:Sort) ~> _3:K</k>_0:Bag</generatedTop> requires [] ensures [] [Location: (5,3,5,60), File: /home/omer/K/k_new_dist/k/issue696/test.k]
rule <generatedTop><k>'test(.KList) ~> _3:K</k>_0:Bag</generatedTop> => <generatedTop><k>Bool(#"true") ~> '_==K_(_2:KResult,, _1:Sort) ~> _3:K</k>_0:Bag</generatedTop> requires [] ensures [] [Location: (5,3,5,60), File: /home/omer/K/k_new_dist/k/issue696/test.k]
```

First two rules are same. I'll fix this too, but that'll be another patch.