@Test
public void testMethodDef() {

  Parser<Member> parser = DeclarationParser.methodDef(
      StatementParser.SYSTEM_MODIFIER, IDENTIFIER, StatementParser.BREAK);
  TerminalParserTest.assertResult(parser, "public static void f();", MethodDef.class, "public static void f();");
  TerminalParserTest.assertResult(parser, "String f() default foo;", MethodDef.class, "String f() default foo;");
  TerminalParserTest.assertResult(parser, "void f() throws E;",
      MethodDef.class, "void f() throws E;");
  TerminalParserTest.assertResult(parser, "void f() throws E, F<T>;",
      MethodDef.class, "void f() throws E, F<T>;");
  TerminalParserTest.assertFailure(parser, "void f() throws", 1, 16);
  TerminalParserTest.assertFailure(parser, "void f() throws E[];", 1, 18);
  TerminalParserTest.assertResult(parser, "void f() {}", MethodDef.class, "void f() {}");
  TerminalParserTest.assertResult(parser, "void f() {break; break;}",
      MethodDef.class, "void f() {break; break;}");
  TerminalParserTest.assertResult(parser, "void f(int i) {}",
      MethodDef.class, "void f(int i) {}");
  TerminalParserTest.assertResult(parser, "void f(final int i, List<Foo> l) {}",
      MethodDef.class, "void f(final int i, List<Foo> l) {}");
  TerminalParserTest.assertResult(parser, "<K, V extends K> void f(int i) {}",
      MethodDef.class, "<K, V extends K> void f(int i) {}");
}