public void runRandomAndCacheType(SelectionCacheType cacheType, int timesCalled) {
TestdataSolution workingSolution = new TestdataSolution();
final List<Object> entityList = Arrays.<Object>asList(
new TestdataEntity("e1"), new TestdataEntity("e2"), new TestdataEntity("e3"));
PlanningEntityDescriptor entityDescriptor = mock(PlanningEntityDescriptor.class);
when(entityDescriptor.extractEntities(workingSolution)).thenReturn(entityList);
FromSolutionEntitySelector entitySelector = new FromSolutionEntitySelector(entityDescriptor, cacheType, true);
Random workingRandom = mock(Random.class);
when(workingRandom.nextInt(3)).thenReturn(1, 0, 0, 2, 1, 2, 2, 1, 0);