import org.assertj.core.api.Assertions;
import org.junit.Test;

public class LogicTest {
    @Test
    public void should_have_correct_instruction_for_tea_with_sugar() throws Exception {
        Assertions.assertThat(new Logic().parseToDrinkMakerProtocol(Drink.Tea, 1))
                .isEqualTo(Drink.Tea.getCode() + ":1:0");
    }

    @Test
    public void should_have_correct_instruction_for_chocolate_without_sugar() throws Exception {
        Assertions.assertThat(new Logic().parseToDrinkMakerProtocol(Drink.Chocolate, 0))
                .isEqualTo(Drink.Chocolate.getCode() + "::");
    }

    @Test
    public void should_have_correct_instruction_for_coffee_with_sugars() throws Exception {
        Assertions.assertThat(new Logic().parseToDrinkMakerProtocol(Drink.Coffee, 2))
                .isEqualTo(Drink.Coffee.getCode() + ":2:0");
    }

    @Test
    public void should_have_correct_message_for_customer_to_see() throws Exception {
        Assertions.assertThat(new Logic().parseToCustomer("M:This is what you ordered"))
        .isEqualTo("This is what you ordered");
    }

    @Test
    public void should_make_drink_when_enough_money_is_given() throws Exception {
        Assertions.assertThat(new Logic().makeDrink(Drink.Tea, 2, 0.4))
                .contains(Drink.Tea.getCode() + ":2:0");
    }

    @Test
    public void should_not_make_drink_when_not_enough_money_is_given() throws Exception {
        Assertions.assertThat(new Logic().makeDrink(Drink.Coffee, 0, 0.2))
                .contains("Need " + String.valueOf(Drink.Coffee.getPrice() - 0.2));
    }
}
@@ -33,16 +33,41 @@
 rtions;%0A
+import org.junit.Before;%0A
 import o
@@ -107,16 +107,133 @@
 cTest %7B%0A
+    private Logic logic;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        logic = new Logic();%0A    %7D%0A%0A
     @Tes
@@ -348,35 +348,29 @@
 .assertThat(
-new L
+l
 ogic
-()
 .parseToDrin
@@ -597,35 +597,29 @@
 .assertThat(
-new L
+l
 ogic
-()
 .parseToDrin
@@ -851,35 +851,29 @@
 .assertThat(
-new L
+l
 ogic
-()
 .parseToDrin
@@ -1098,27 +1098,21 @@
 ertThat(
-new L
+l
 ogic
-()
 .parseTo
@@ -1324,35 +1324,29 @@
 .assertThat(
-new L
+l
 ogic
-()
 .makeDrink(D
@@ -1558,27 +1558,21 @@
 ertThat(
-new L
+l
 ogic
-()
 .makeDri

Add a 'setUp' function to instantiate Logic once