### Question:
MetricThresholdBelow extends MetricThreshold { @Override public boolean evaluate(MetricValue value) { return value.convertTo(getThreshold().getUnit()).getValue() < getThreshold().getValue(); } MetricThresholdBelow(MetricValue threshold); @Override boolean evaluate(MetricValue value);  }### Answer:
@Test public void testThresholdEvaluation() { System.out.println("testThresholdEvaluation"); MetricValue thresholdValue = new MetricValue(); thresholdValue.setValue(10); thresholdValue.setUnit(MetricUnit.GIGABYTES); MetricThresholdBelow threshold = new MetricThresholdBelow(thresholdValue); MetricValue value = new MetricValue(); value.setValue(1); value.setUnit(MetricUnit.GIGABYTES); assertTrue("The value is below the threshold", threshold.evaluate(value)); }
@Test public void testThresholdEvaluationWithUnitConversion() { System.out.println("testThresholdEvaluationWithUnitConversion"); MetricValue thresholdValue = new MetricValue(); thresholdValue.setValue(10); thresholdValue.setUnit(MetricUnit.GIGABYTES); MetricThresholdBelow threshold = new MetricThresholdBelow(thresholdValue); MetricValue value = new MetricValue(); value.setValue(500); value.setUnit(MetricUnit.MEGABYTES); assertTrue("The value is below the threshold", threshold.evaluate(value)); }