PlaceholderSubstitution implements Function<WithDittoHeaders, CompletionStage<WithDittoHeaders>> { public static PlaceholderSubstitution newInstance() { final Map<String, Function<DittoHeaders, String>> defaultReplacementDefinitions = createDefaultReplacementDefinitions(); return createInstance(defaultReplacementDefinitions); } private  PlaceholderSubstitution(final HeaderBasedPlaceholderSubstitutionAlgorithm substitutionAlgorithm,
            final SubstitutionStrategyRegistry substitutionStrategyRegistry); static PlaceholderSubstitution newInstance(); static PlaceholderSubstitution newExtendedInstance(
            final Map<String, Function<DittoHeaders, String>> additionalReplacementDefinitions); @Override CompletionStage<WithDittoHeaders> apply(final WithDittoHeaders withDittoHeaders);  }
@Test public void applyWithHandledCommandReturnsTheReplacedCommandInstanceWhenLegacyPlaceholderIsSpecified() { final ModifySubject commandWithoutPlaceholders = ModifySubject.of(PolicyId.of("org.eclipse.ditto:my-policy"), Label.of("my-label"), Subject.newInstance("${request.subjectId}", SubjectType.GENERATED), DITTO_HEADERS); final WithDittoHeaders response = applyBlocking(commandWithoutPlaceholders); final ModifySubject expectedCommandWithPlaceholders = ModifySubject.of(commandWithoutPlaceholders.getEntityId(), commandWithoutPlaceholders.getLabel(), Subject.newInstance(SUBJECT_ID, SubjectType.GENERATED), DITTO_HEADERS); assertThat(response).isEqualTo(expectedCommandWithPlaceholders); }