Solution 06 is quite good (maybe perfect) from the perspective of binary compatibility. For a while I thought I am going to give up, however then I noticed that there is an added overloaded method. With proper parameters this can cause the previously OK source to become uncompilable.
3 import java.util.Currency;
4 import junit.framework.TestCase;
5 import org.apidesign.apifest08.currency.Convertor;
8 /** Write a test that works with version from task A and fails with version B.
10 public class CurrencyTest extends TestCase {
11 public CurrencyTest(String n) {
15 public void testCompatibility() throws Exception {
16 Currency cur1 = Currency.getInstance("CZK");
17 Currency cur2 = Currency.getInstance("SKK");
18 Convertor c = new Convertor(null, cur1, cur2);