### Question:
Highest extends Activation { @Override public void activate(RuleBlock ruleBlock) { if (FuzzyLite.isDebugging()) { FuzzyLite.logger().log(Level.FINE, "Activation: {0} {1}", new String[]{getClass().getName(), parameters()}); } TNorm conjunction = ruleBlock.getConjunction(); SNorm disjunction = ruleBlock.getDisjunction(); TNorm implication = ruleBlock.getImplication(); PriorityQueue<Rule> rulesToActivate = new PriorityQueue<Rule>( numberOfRules, new Descending()); for (Rule rule : ruleBlock.getRules()) { rule.deactivate(); if (rule.isLoaded()) { double activationDegree = rule.activateWith(conjunction, disjunction); if (Op.isGt(activationDegree, 0.0)) { rulesToActivate.offer(rule); } } } int activated = 0; while (!rulesToActivate.isEmpty() && activated++ < numberOfRules) { rulesToActivate.poll().trigger(implication); } } Highest();  Highest(int numberOfRules); @Override String parameters(); @Override void configure(String parameters); @Override void activate(RuleBlock ruleBlock); int getNumberOfRules(); void setNumberOfRules(int numberOfRules); @Override Highest clone();  }### Answer:
@Test public void testActivate() { Engine engine = Console.mamdani(); InputVariable ambient = engine.getInputVariable(0); ambient.setValue(0.3); RuleBlock ruleBlock = engine.getRuleBlock(0); ruleBlock.setActivation(new Highest(1)); engine.process(); List<Rule> rules = engine.getRuleBlock(0).getRules(); Assert.assertThat("First rule was fired", rules.get(0).isTriggered(), is(true)); Assert.assertThat("Second rule was not fired", rules.get(1).isTriggered(), is(false)); Assert.assertThat("Third rule was not fired", rules.get(2).isTriggered(), is(false)); ruleBlock.setActivation(new Highest(2)); engine.process(); Assert.assertThat("First rule was fired", rules.get(0).isTriggered(), is(true)); Assert.assertThat("Second rule was fired", rules.get(1).isTriggered(), is(true)); Assert.assertThat("Third rule was not fired", rules.get(2).isTriggered(), is(false)); }