@Test
public void test_DocumentationShouldStickToElement() throws Exception {
// issue caused documentation comment to be separated from its element
String code = "class foo {\n}\n# doc\nclass foo {\n}\n";
String fmt = "class foo {\n}\n\n# doc\nclass foo {\n}\n";
XtextResource r = getResourceFromString(code);
String s = serializeFormatted(r.getContents().get(0));
assertEquals("formatting should produce wanted result", fmt, s);
code = "class foo {\n}\n/* doc */\nclass foo {\n}\n";
fmt = "class foo {\n}\n\n/* doc */\nclass foo {\n}\n";
r = getResourceFromString(code);
s = serializeFormatted(r.getContents().get(0));
assertEquals("formatting should produce wanted result", fmt, s);
}