@Test
  public void testCustomSSPGrouper() {
    // custom grouper only groups into two tasks, so only need 2 changelog partitions
    Map<TaskName, Integer> changelogPartitionMapping = changelogPartitionMapping(2);
    Config config = config(ImmutableList.of(SYSTEM_STREAM0, SYSTEM_STREAM1),
        ImmutableMap.of(JobConfig.SSP_GROUPER_FACTORY, Partition0SeparateFactory.class.getName()));
    when(this.grouperMetadata.getProcessorLocality()).thenReturn(
        ImmutableMap.of("0", mock(LocationId.class), "1", mock(LocationId.class)));
    Set<SystemStreamPartition> sspsForTask1 = new ImmutableSet.Builder<SystemStreamPartition>().add(
        new SystemStreamPartition(SYSTEM_STREAM0, new Partition(1)))
        .add(new SystemStreamPartition(SYSTEM_STREAM0, new Partition(2)))
        .add(new SystemStreamPartition(SYSTEM_STREAM0, new Partition(3)))
        .add(new SystemStreamPartition(SYSTEM_STREAM1, new Partition(1)))
        .add(new SystemStreamPartition(SYSTEM_STREAM1, new Partition(2)))
        .build();
    Map<String, ContainerModel> containerModels =
        ImmutableMap.of("0", new ContainerModel("0", ImmutableMap.of(taskName(0), taskModel(0, 0, 0))), "1",
            new ContainerModel("1",
                ImmutableMap.of(taskName(1), new TaskModel(taskName(1), sspsForTask1, new Partition(1)))));
    JobModel expected = new JobModel(config, containerModels);
    JobModel actual =
        JobModelCalculator.INSTANCE.calculateJobModel(config, changelogPartitionMapping, this.streamMetadataCache,
            this.grouperMetadata);
    assertEquals(expected, actual);
  }
Unfortunately, we still need powermock for testing the regex topic flow, since that flow checks for a specific
rewriter class, and setting up the support for that specific class is too cumbersome.
Many of the tests do not need powermock.
samza-core/src/test/java/org/apache/samza/coordinator/TestJobModelCalculator.java