### Question:
ConstraintPlaceholderHelper { public String getPlaceholderSentence(final String type) { final String sentence = getTranslation(type, CONSTRAINT_PLACEHOLDER_SENTENCE_PREFIX); return !isEmpty(sentence) ? sentence : defaultSentence(); } @Inject  ConstraintPlaceholderHelper(final TranslationService translationService); String getPlaceholderSentence(final String type); String getPlaceholderSample(final String type);  }### Answer:
@Test public void testGetPlaceholderSentenceWhenTypeIsBuiltInTypeWithoutDefinedSentence() { final String expectedPlaceholder = "Enter a valid expression"; when(translationService.format("ConstraintPlaceholderHelper.SentenceDefault")).thenReturn(expectedPlaceholder); final String actualPlaceholder = placeholderHelper.getPlaceholderSentence("context"); assertEquals(expectedPlaceholder, actualPlaceholder); }
@Test public void testGetPlaceholderSentenceWhenTypeIsNotBuiltInType() { final String expectedPlaceholder = "Enter a valid expression"; when(translationService.format("ConstraintPlaceholderHelper.SentenceDefault")).thenReturn(expectedPlaceholder); final String actualPlaceholder = placeholderHelper.getPlaceholderSentence("Structure"); assertEquals(expectedPlaceholder, actualPlaceholder); }