@Test
public void testToApplicationKey() {

    final TreeSet<String> capabilities = new TreeSet<>();
    capabilities.add(B2Capabilities.WRITE_FILES);
    assertEquals(
            new B2ApplicationKey(
                    "accountId",
                    "appKeyId",
                    "keyName",
                    capabilities,
                    "bucketId",
                    "namePrefix",
                    12345678L,
                    B2TestHelpers.makeBucketOrApplicationKeyOptions()
            ),
            new B2CreatedApplicationKey(
                    "accountId",
                    "appKeyId",
                    "appKeySecret",
                    "keyName",
                    capabilities,
                    "bucketId",
                    "namePrefix",
                    12345678L,
                    B2TestHelpers.makeBucketOrApplicationKeyOptions()
            ).toApplicationKey()
    );
}