  @Test
  public void testExample() throws Exception {

    Example example = new Example(10);

    Region<Integer, String> region = mock(Region.class);
    List<Integer> primes = Arrays.asList(1, 2, 3, 5, 7);
    ResultCollector resultCollector = mock(ResultCollector.class);
    when(resultCollector.getResult()).thenReturn(primes);
    Execution execution = mock(Execution.class);
    when(execution.execute(PrimeNumber.ID)).thenReturn(resultCollector);

    assertEquals(new HashSet(primes), example.getPrimes(region, execution));
  }