@Test
public void testUnsupportedModifier() {

    final DetailAstImpl sync = new DetailAstImpl();
    sync.setType(TokenTypes.LITERAL_SYNCHRONIZED);
    final DetailAstImpl ident = new DetailAstImpl();
    ident.setType(TokenTypes.IDENT);
    ident.setText("dummy");
    final DetailAstImpl type = new DetailAstImpl();
    type.setType(TokenTypes.TYPE);
    type.addChild(ident);
    final DetailAstImpl child = new DetailAstImpl();
    child.setType(TokenTypes.MODIFIERS);
    child.addChild(sync);
    final DetailAstImpl node = new DetailAstImpl();
    node.addChild(type);
    node.addChild(child);
    final DetailAstImpl parent = new DetailAstImpl();
    parent.setType(TokenTypes.OBJBLOCK);
    parent.addChild(node);
    final AvoidModifiersForTypesCheck check = new AvoidModifiersForTypesCheck();
    try {
        check.visitToken(node);
        fail("exception expected");
    }
    catch (IllegalArgumentException ex) {
        Assert.assertEquals("Found unsupported token: LITERAL_SYNCHRONIZED", ex.getMessage());
    }
}