@Test
  public void testGetStartingOffsetsWhenStreamMetadataIsNull() {
    final String taskName = "test-get-starting-offset-task";

    Set<SystemStreamPartition> ssps = IntStream.range(1, 2)
        .mapToObj(idx -> new SystemStreamPartition(TEST_SYSTEM, TEST_STREAM, new Partition(idx)))
        .collect(Collectors.toSet());
    Map<Partition, SystemStreamMetadata.SystemStreamPartitionMetadata> partitionMetadata = ssps.stream()
        .collect(Collectors.toMap(SystemStreamPartition::getPartition,
          x -> new SystemStreamMetadata.SystemStreamPartitionMetadata(null, "1", "2")));


    TaskSideInputHandler handler = new MockTaskSideInputHandlerBuilder(taskName, TaskMode.Active)
        .addStreamMetadata(Collections.singletonMap(new SystemStream(TEST_SYSTEM, TEST_STREAM),
            new SystemStreamMetadata(TEST_STREAM, partitionMetadata)))
        .addStore(TEST_STORE, ssps)
        .build();

    handler.init();

    ssps.forEach(ssp -> {
      String startingOffset = handler.getStartingOffset(
          new SystemStreamPartition(TEST_SYSTEM, TEST_STREAM, ssp.getPartition()));
      Assert.assertNull("Starting offset should be null", startingOffset);
    });
  }
This test is for cases, when calls to systemAdmin (e.g., KafkaSystemAdmin's) get-stream-metadata method return null.
samza-core/src/test/java/org/apache/samza/storage/TestTaskSideInputHandler.java