@Override
    public boolean betterThan(Num criterionValue1, Num criterionValue2) {
        return positionFilter == PositionFilter.PROFIT ? criterionValue1.isGreaterThan(criterionValue2)
                : criterionValue1.isLessThan(criterionValue2);
    }
@Test
    public void betterThan() {
        AnalysisCriterion criterionLoss = getCriterion(PositionFilter.LOSS);
        assertTrue(criterionLoss.betterThan(numOf(3), numOf(6)));
        assertFalse(criterionLoss.betterThan(numOf(7), numOf(4)));

        AnalysisCriterion criterionProfit = getCriterion(PositionFilter.PROFIT);
        assertFalse(criterionProfit.betterThan(numOf(3), numOf(6)));
        assertTrue(criterionProfit.betterThan(numOf(7), numOf(4)));
    }