@Test
public void testEquals() {

    final TreeSet<String> capabilities = new TreeSet<>();
    capabilities.add(B2Capabilities.WRITE_FILES);
    capabilities.add(B2Capabilities.READ_FILES);
    capabilities.add(B2Capabilities.LIST_ALL_BUCKET_NAMES);
    capabilities.add(B2Capabilities.READ_BUCKETS);
    final B2ApplicationKey applicationKey =
            new B2ApplicationKey(
                    "accountId",
                    "appKeyId",
                    "keyName",
                    capabilities,
                    "bucketId",
                    "namePrefix",
                    12345678L,
                    B2TestHelpers.makeBucketOrApplicationKeyOptions()
            );
    final String applicationKeyJson = B2Json.toJsonOrThrowRuntime(applicationKey);
    final B2ApplicationKey convertedApplicationKey =
            B2Json.fromJsonOrThrowRuntime(applicationKeyJson, B2ApplicationKey.class);
    assertEquals(applicationKey, convertedApplicationKey);
}