We are using custom classes to communicate with Wikibase API for testing. However, WikidataToolkit already has APIs doing what we need. We may want to consider switching to using those classes for tests, so we do not have to maintain that code.
Example of how Wikidata Toolkit works is here: https://github.com/Wikidata/Wikidata-Toolkit/blob/master/wdtk-examples/src/main/java/org/wikidata/wdtk/examples/EditOnlineDataExample.java
Javadocs are here: https://wikidata.github.io/Wikidata-Toolkit/overview-summary.html