private static String getFragmentContent(PsiFragment fragment) {
    final IElementType tokenType = fragment.getTokenType();

    if (tokenType == JavaTokenType.STRING_TEMPLATE_BEGIN || tokenType == JavaTokenType.STRING_TEMPLATE_MID) {
      String text = fragment.getText();
      return text.substring(1, text.length() - 2);
    }
    else if (tokenType == JavaTokenType.STRING_TEMPLATE_END) {
      String text = fragment.getText();
      if (!(text.endsWith("\""))) {
        return null;
      }
      return text.substring(1, text.length() - 1);
    }

    return getTextBlockFragmentContent(fragment);
  }
private static String getFragmentContent(PsiFragment fragment)