private static void doTestSamzaPropertyPriority(String propertyName, String value, SamzaPropertyAssertion assertion) {
    // streams.<streamId>.<property> vs. systems.<system>.streams.<stream>.<property>
    assertion.doAssertion(new StreamConfig(new MapConfig(ImmutableMap.of(
        String.format(StreamConfig.STREAM_ID_PREFIX, STREAM_ID) + propertyName, value,
        // all streams need to have a system
        JobConfig.JOB_DEFAULT_SYSTEM, SYSTEM,
        // this config should not be used
        String.format(StreamConfig.STREAM_PREFIX, SYSTEM, STREAM_ID) + propertyName, UNUSED_VALUE))),
        SYSTEM_STREAM);

    // systems.<system>.streams.<stream>.<property> vs. systems.<system>.default.stream.<property>
    assertion.doAssertion(new StreamConfig(new MapConfig(ImmutableMap.of(
        String.format(StreamConfig.STREAM_PREFIX, SYSTEM, STREAM_ID) + propertyName, value,
        // specify the system for the stream id
        String.format(StreamConfig.SYSTEM_FOR_STREAM_ID, STREAM_ID), SYSTEM,
        // this config should not be used
        String.format(SystemConfig.SYSTEM_DEFAULT_STREAMS_PREFIX_FORMAT, SYSTEM) + propertyName, UNUSED_VALUE))),
        SYSTEM_STREAM);

    /*
     * The next logical case to check would be systems.<system>.default.stream.<property> with a system mapping in the
     * config vs. systems.<system>.streams.<stream>.<property> with a system mapping, but that is not possible, so move
     * on to the next case.
     */

    /*
     * systems.<system>.streams.<stream>.<property> without a system mapping in the config vs.
     * systems.<system>.default.stream.<property> without a system mapping in the config
     */
    assertion.doAssertion(new StreamConfig(new MapConfig(ImmutableMap.of(
        String.format(StreamConfig.STREAM_PREFIX, SYSTEM, STREAM_ID) + propertyName, value,
        // this config should not be used
        String.format(SystemConfig.SYSTEM_DEFAULT_STREAMS_PREFIX_FORMAT, SYSTEM) + propertyName, UNUSED_VALUE))),
        SYSTEM_STREAM);
  }
Tests that certain properties have priority over others. For conciseness, this will not explicitly test priorities
for all different ways of specifying a property. This will compare two options at a time, and then we can infer
priorities transitively.
samza-core/src/test/java/org/apache/samza/config/TestStreamConfig.java