public class AcceptNewRemoveWorstTest {
@Test
public void whenHavingNewSolAndLimitedMemory_removeWorstAndAddNew(){
VehicleRoutingProblemSolution sol1 = mock(VehicleRoutingProblemSolution.class);
VehicleRoutingProblemSolution sol2 = mock(VehicleRoutingProblemSolution.class);
when(sol1.getCost()).thenReturn(1.0);
when(sol2.getCost()).thenReturn(2.0);
List<VehicleRoutingProblemSolution> solList = new ArrayList<VehicleRoutingProblemSolution>();
solList.add(sol1);
solList.add(sol2);
VehicleRoutingProblemSolution sol3 = mock(VehicleRoutingProblemSolution.class);
new GreedyAcceptance(2).acceptSolution(solList, sol3);
assertEquals(2,solList.size());
assertThat(sol3,is(solList.get(1)));