Skip to content

Instantly share code, notes, and snippets.

@martinschaef
Created January 11, 2017 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinschaef/24c922b0e75a09af3ba3dae5500d118d to your computer and use it in GitHub Desktop.
Save martinschaef/24c922b0e75a09af3ba3dae5500d118d to your computer and use it in GitHub Desktop.
import com.google.common.base.Verify;
/**
* @author schaef
* Examples of how to use library stubs
* to find more bugs with Python.
*/
public class BixieStubTest {
public void guavaContracts01(int x) {
Verify.verify(x==0);
if (x!=0) {
System.err.println(x);
}
}
public void guavaContracts02(int x) {
Verify.verify(x==0, "Error {} {}", "1", "2");
if (x!=0) {
System.err.println(x);
}
}
public void guavaContracts03(Object o) {
Verify.verifyNotNull(o, "Error {} {}", "1", "2");
o.toString();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment