public static Map<Integer, List<Profile>> generatePartitionedProfiles(int numProfiles, int partitionCount) {
    Random random = new Random();
    return IntStream.range(0, numProfiles)
        .mapToObj(i -> {
          String company = COMPANIES[random.nextInt(COMPANIES.length - 1)];
          return new Profile(i, company);
        })
        .collect(Collectors.groupingBy(
          profile -> Math.abs(Arrays.hashCode(INTEGER_SERDE.toBytes(profile.getMemberId()))) % partitionCount));
  }
Create profiles and partition them based on the bytes representation of the member id. This uses the bytes
representation for partitioning because this needs to use the same partition function as the InMemorySystemProducer
(which is used in the test framework) so that table joins can be tested.
One profile for each member id in [0, numProfiles) is created.
samza-test/src/test/java/org/apache/samza/test/table/TestTableData.java