package patterns.document;

import java.util.HashMap;
import java.util.Map;
import java.util.OptionalDouble;
import java.util.OptionalInt;

import org.junit.Test;

import org.junit.Assert;

public class CarTest {

	private static final double PRICE = 100.0;
	private static final String MODEL = "Audi";
	private static final String COLOR = "red";
	private static final int WHEELS_COUNT = 4;

	@Test
	public void testCreateCar() throws Exception {
		Map<String, Object> entries = new HashMap<>();
		Car car = new Car(entries);

		car.put(ColorTrait.KEY, COLOR);
		car.put(ModelTrait.KEY, MODEL);
		car.put(PriceTrait.KEY, PRICE);
		car.put(WheelsTrait.KEY, WHEELS_COUNT);

		String color = car.getColor();
		Assert.assertEquals(COLOR, color);
		String model = car.getModel();
		Assert.assertEquals(MODEL, model);
		OptionalDouble price = car.getPrice();
		Assert.assertEquals(PRICE, price.getAsDouble());
		OptionalInt wheels = car.getWheels();
		Assert.assertEquals(WHEELS_COUNT, wheels.getAsInt());
	}
}

@@ -161,15 +161,15 @@
 nit.
-Test;%0D%0A
+Assert;
 %0D%0Aim
@@ -179,29 +179,27 @@
 t org.junit.
-Asser
+Tes
 t;%0D%0A%0D%0Apublic
@@ -218,16 +218,64 @@
 st %7B%0D%0A%0D%0A
+%09private static final double DELTA = 0.000001;%0D%0A
 %09private
@@ -973,16 +973,23 @@
 Double()
+, DELTA
 );%0D%0A%09%09Op

Fix test after JUnit upgrade