### Question:
MetricThresholdAbove extends MetricThreshold { @Override public boolean evaluate(MetricValue value) { return value.convertTo(getThreshold().getUnit()).getValue() > getThreshold().getValue(); } MetricThresholdAbove(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); MetricThresholdAbove threshold = new MetricThresholdAbove(thresholdValue); MetricValue value = new MetricValue(); value.setValue(20); 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(20); thresholdValue.setUnit(MetricUnit.MEGABYTES); MetricThresholdAbove threshold = new MetricThresholdAbove(thresholdValue); MetricValue value = new MetricValue(); value.setValue(1); value.setUnit(MetricUnit.GIGABYTES); assertTrue("The value is below the threshold", threshold.evaluate(value)); }