@Test public void shouldThrowError() throws Exception { thrown.expect(AbstractMethodError.class); thrown.expectMessage("anotherMethod"); InstantiateWithMethodMissing.main(new String[0]); }
public static void main(String[] args) throws Exception { AnInterface anInterface = B.createAnInterface(); anInterface.anotherMethod("hey"); }
InstantiateWithMethodMissing { public static void main(String[] args) throws Exception { AnInterface anInterface = B.createAnInterface(); anInterface.anotherMethod("hey"); } }
InstantiateWithMethodMissing { public static void main(String[] args) throws Exception { AnInterface anInterface = B.createAnInterface(); anInterface.anotherMethod("hey"); }  }
InstantiateWithMethodMissing { public static void main(String[] args) throws Exception { AnInterface anInterface = B.createAnInterface(); anInterface.anotherMethod("hey"); }  static void main(String[] args); }
InstantiateWithMethodMissing { public static void main(String[] args) throws Exception { AnInterface anInterface = B.createAnInterface(); anInterface.anotherMethod("hey"); }  static void main(String[] args);  }