@Test public void shouldThrowError() throws Exception { thrown.expect(IllegalAccessError.class); thrown.expectMessage("accessLevelToChange"); MethodBecameInaccessible.main(new String[0]); }
public static void main(String[] args) { B.methodBecameInaccessible(); }
MethodBecameInaccessible { public static void main(String[] args) { B.methodBecameInaccessible(); } }
MethodBecameInaccessible { public static void main(String[] args) { B.methodBecameInaccessible(); }  }
MethodBecameInaccessible { public static void main(String[] args) { B.methodBecameInaccessible(); }  static void main(String[] args); }
MethodBecameInaccessible { public static void main(String[] args) { B.methodBecameInaccessible(); }  static void main(String[] args);  }