@@ -0,0 +1,2202 @@
+package de.developgroup.mrf.rover.collision;%0A%0Aimport com.pi4j.io.gpio.GpioController;%0Aimport de.developgroup.mrf.server.ClientManager;%0Aimport de.developgroup.mrf.server.rpc.JsonRpc2Request;%0Aimport org.junit.Assert;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.ArgumentCaptor;%0Aimport org.mockito.Mockito;%0A%0Aimport static org.mockito.Mockito.verify;%0A%0Apublic class CollisionRunnableTest %7B%0A%0A    CollisionRunnable runnable;%0A    IRSensorFactory irSensorFactory;%0A    GpioController gpio;%0A    ClientManager clientManager;%0A%0A    @Before%0A    public void setUp() %7B%0A        irSensorFactory = Mockito.mock(IRSensorFactory.class);%0A        gpio = Mockito.mock(GpioController.class);%0A        clientManager = Mockito.mock(ClientManager.class);%0A%0A        runnable = new CollisionRunnable(irSensorFactory, gpio, clientManager);%0A    %7D%0A%0A    @Test%0A    public void testSendToClients() %7B%0A        ArgumentCaptor%3CJsonRpc2Request%3E requestCaptor = ArgumentCaptor.forClass(JsonRpc2Request.class);%0A        RoverCollisionInformation info = new RoverCollisionInformation();%0A%0A        runnable.sendToClients(info);%0A%0A        verify(clientManager).notifyAllClients(requestCaptor.capture());%0A        JsonRpc2Request actualRequest = requestCaptor.getValue();%0A        Assert.assertEquals(info, actualRequest.getParams().get(0));%0A        Assert.assertEquals(%22updateCollisionInformation%22, actualRequest.getMethod());%0A    %7D%0A%0A    @Test%0A    public void testConvertSensorReadingToCollisionState() %7B%0A        Assert.assertEquals(CollisionState.None, runnable.convertSensorReadingToCollisionState(0.2));%0A        Assert.assertEquals(CollisionState.None, runnable.convertSensorReadingToCollisionState(0.34));%0A        Assert.assertEquals(CollisionState.Far, runnable.convertSensorReadingToCollisionState(0.35));%0A        Assert.assertEquals(CollisionState.Far, runnable.convertSensorReadingToCollisionState(0.39));%0A        Assert.assertEquals(CollisionState.Medium, runnable.convertSensorReadingToCollisionState(0.4));%0A        Assert.assertEquals(CollisionState.Medium, runnable.convertSensorReadingToCollisionState(0.49));%0A        Assert.assertEquals(CollisionState.Close, runnable.convertSensorReadingToCollisionState(0.5));%0A    %7D%0A%7D%0A

Add unit tests for CollisionRunnable