@Test
public void testSourceLocationAwareSchedulingWithMultiSource() throws InjectionException {

  final SchedulingConstraint schedulingConstraint = injector
    .getInstance(LocalitySchedulingConstraint.class);
  // Prepare test scenario
  final Task task0 = CreateTask.withReadablesWithSourceLocations(
    Collections.singletonList(Collections.singletonList(SITE_1)));
  final Task task1 = CreateTask.withReadablesWithSourceLocations(
    Collections.singletonList(Arrays.asList(SITE_0, SITE_1, SITE_2)));
  final Task task2 = CreateTask.withReadablesWithSourceLocations(
    Arrays.asList(Collections.singletonList(SITE_0), Collections.singletonList(SITE_1),
      Arrays.asList(SITE_1, SITE_2)));
  final Task task3 = CreateTask.withReadablesWithSourceLocations(
    Arrays.asList(Collections.singletonList(SITE_1), Collections.singletonList(SITE_0),
      Arrays.asList(SITE_0, SITE_2)));
  final ExecutorRepresenter e = mockExecutorRepresenter(SITE_1);
  for (final Task task : new HashSet<>(Arrays.asList(task0, task1, task2, task3))) {
    assertTrue(schedulingConstraint.testSchedulability(e, task));
  }
}