Add property-based tests and fix the bugs discovered.

Change-Id: I8deb1a7d75078c037714541d8f6f656052c2476c
diff --git a/.gitignore b/.gitignore
index b8b3920..944aa9a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@
 *~
 .envrc
 .flattened-pom.xml
+.jqwik-database
 /.idea
 /jgvariant-*/target
 /target