Example code in README.md
@@ -14,3 +14,20 @@ current stable version of junit-quickcheck.
[Version 0.8-alpha-5](http://pholser.github.io/junit-quickcheck/site/0.8-alpha-5/)
is available.
+
+## Basic example
+
+```java
+ import com.pholser.junit.quickcheck.Property;
+ import com.pholser.junit.quickcheck.runner.JUnitQuickcheck;
+ import org.junit.runner.RunWith;
+
+ import static org.junit.Assert.*;
+
+ @RunWith(JUnitQuickcheck.class)
+ public class StringProperties {
+ @Property public void concatenationLength(String s1, String s2) {
+ assertEquals(s1.length() + s2.length(), (s1 + s2).length());
+ }
+ }
+```
