@Override
  public boolean needScatterGather(String serviceName) throws ServiceUnavailableException
  {
    return isPartitioningEnabled(serviceName) || isStickyEnabled(serviceName);
  }
@Test
  public void testNeedScatterGather() throws ServiceUnavailableException
  {
    // Both sticky and partitioned
    HashRingProvider ringProvider = createStaticHashRingProvider(100, 10, getHashFunction(true));
    PartitionInfoProvider infoProvider = createRangeBasedPartitionInfoProvider(10);
    URIMapper mapper = new RingBasedUriMapper(ringProvider, infoProvider);
    Assert.assertTrue(mapper.needScatterGather(TEST_SERVICE));

    // Only sticky
    ringProvider = createStaticHashRingProvider(100, 1, getHashFunction(true));
    infoProvider = createRangeBasedPartitionInfoProvider(1);
    mapper = new RingBasedUriMapper(ringProvider, infoProvider);
    Assert.assertTrue(mapper.needScatterGather(TEST_SERVICE));

    // Only partitioned
    ringProvider = createStaticHashRingProvider(100, 10, getHashFunction(false));
    infoProvider = createRangeBasedPartitionInfoProvider(10);
    mapper = new RingBasedUriMapper(ringProvider, infoProvider);
    Assert.assertTrue(mapper.needScatterGather(TEST_SERVICE));

    // neither
    ringProvider = createStaticHashRingProvider(100, 1, getHashFunction(false));
    infoProvider = createRangeBasedPartitionInfoProvider(1);
    mapper = new RingBasedUriMapper(ringProvider, infoProvider);
    Assert.assertFalse(mapper.needScatterGather(TEST_SERVICE));
  }