source: class ForbidCertainMethodCheckTest extends AbstractCheck {
  
      @Test
      public void testUnsupportedToken() {
  
target:         final DetailAstImpl sync = new DetailAstImpl();
          sync.setType(TokenTypes.LITERAL_SYNCHRONIZED);
          try {
              final ForbidCertainMethodCheck check = new ForbidCertainMethodCheck();
              check.visitToken(sync);
              Assert.fail("Expecting IllegalArgumentException");
          }
          catch (IllegalArgumentException ex) {
              Assert.assertEquals("Found unsupported token: LITERAL_SYNCHRONIZED", ex.getMessage());
          }
      }
  
  }