@Test public void shouldThrowError() throws Exception { thrown.expect(NoSuchMethodError.class); thrown.expectMessage(")Ljava/lang/String;"); ReturnTypeChange.main(new String[0]); }
public static void main(String[] args) { B.specificReturnTypeBroken(new SpecificReturnType() { @Override public Object aMethod(String parameter) { return parameter.length(); } @Override public Object anotherMethod(String parameter) throws Exception { throw new UnsupportedOperationException(); } }); }
ReturnTypeChange { public static void main(String[] args) { B.specificReturnTypeBroken(new SpecificReturnType() { @Override public Object aMethod(String parameter) { return parameter.length(); } @Override public Object anotherMethod(String parameter) throws Exception { throw new UnsupportedOperationException(); } }); } }
ReturnTypeChange { public static void main(String[] args) { B.specificReturnTypeBroken(new SpecificReturnType() { @Override public Object aMethod(String parameter) { return parameter.length(); } @Override public Object anotherMethod(String parameter) throws Exception { throw new UnsupportedOperationException(); } }); }  }
ReturnTypeChange { public static void main(String[] args) { B.specificReturnTypeBroken(new SpecificReturnType() { @Override public Object aMethod(String parameter) { return parameter.length(); } @Override public Object anotherMethod(String parameter) throws Exception { throw new UnsupportedOperationException(); } }); }  static void main(String[] args); }
ReturnTypeChange { public static void main(String[] args) { B.specificReturnTypeBroken(new SpecificReturnType() { @Override public Object aMethod(String parameter) { return parameter.length(); } @Override public Object anotherMethod(String parameter) throws Exception { throw new UnsupportedOperationException(); } }); }  static void main(String[] args);  }