static void validateBundlingRelatedOptions(SamzaPipelineOptions pipelineOptions) {
    if (pipelineOptions.getMaxBundleSize() > 1) {
      final Map<String, String> configs =
          pipelineOptions.getConfigOverride() == null
              ? new HashMap<>()
              : pipelineOptions.getConfigOverride();
      final JobConfig jobConfig = new JobConfig(new MapConfig(configs));

      // Validate that the threadPoolSize is not override in the code
      checkArgument(
          jobConfig.getThreadPoolSize() <= 1,
          JOB_CONTAINER_THREAD_POOL_SIZE
              + " config should be replaced with SamzaPipelineOptions.numThreadsForProcessElement");
    }
  }
@Test(expected = IllegalArgumentException.class)
  public void testBundleEnabledInMultiThreadedModeThrowsException() {
    SamzaPipelineOptions mockOptions = mock(SamzaPipelineOptions.class);
    Map<String, String> config = ImmutableMap.of(JOB_CONTAINER_THREAD_POOL_SIZE, "10");

    when(mockOptions.getMaxBundleSize()).thenReturn(2L);
    when(mockOptions.getConfigOverride()).thenReturn(config);
    validateBundlingRelatedOptions(mockOptions);
  }