class CalculPrice {

    public static final double getGenericPrice(double price, double discount, double taxe, int binaryMask) {
        if (hasOption(binaryMask, Type.DISCOUNT_COST)) {
            return getDiscountCost(price, discount);
        }
        if (hasOption(binaryMask, Type.TAXE_COST)) {
            return getTaxCost(price, taxe);
        }
        if (hasOption(binaryMask, Type.DISCOUNT)) {
            price = applyDiscount(price, discount);
        }
        if (hasOption(binaryMask, Type.TAXE)) {
            price = applyTax(price, taxe);
        }
        return price;
    }

}

class CalculPriceTest {

    private static final double delta;
    private final double price;
    private final double taxe;
    private final double discount;

    @Test
    public void getPriceWithDiscountWithoutTaxeTest() {

        double discount = 0.2d;
        final double control = 40d;
        assertEquals(control, getGenericPrice(price, discount, taxe, Type.DISCOUNT));
    }

}