A formalism for specification of Java API interfaces