Part of amber-clients: Java version.