### Question:
MessageSourceInterpolator extends DelegatingMessageInterpolator { @VisibleForTesting String translate(String templateKey) { if (templateKey.startsWith("{") && templateKey.endsWith("}")) { templateKey = templateKey.substring(1, templateKey.length() - 1); } try { Object[] args = {}; return source.getMessage(templateKey, args, Locale.getDefault()); } catch (NoSuchMessageException e) { return templateKey; } } MessageSourceInterpolator(MessageInterpolator delegate); @Override String doInterpolate(String messageTemplate, Context context);  }### Answer:
@Test public void testTranslateStripBrackets() { String key = "{javax.validation.constraint.myconstraint.message}"; String output = interpolator.translate(key); assertEquals("javax.validation.constraint.myconstraint.message", output); }
@Test public void testTranslateStripNoBrackets() { String key = "javax.validation.constraint.myconstraint.message"; String output = interpolator.translate(key); assertEquals("javax.validation.constraint.myconstraint.message", output); }