One of the “right object-oriented” answers would be to define an interface for the “rule” (using the condition () and action () methods), create 3 implementations, embed them in a collection, and then simply repeat through them in general form in:
List <Rule> rules = ....; // your 3 rules initialized here somehow
for (Rule r: rules) {
if (r.condition ()) {
r.action();
}
}
, 300 /, 3.
Java8 , :
rules.parallelStream().filter(r -> r.condition()).forEach(r -> r.action());