public static DeviceKey createDeviceKeyUsingCommunityName(DeviceKeyId id, String label, String name) {
        DefaultAnnotations annotations = builder().set(AnnotationKeys.NAME, name).build();

        return new DeviceKey(id, label, Type.COMMUNITY_NAME, annotations);
    }
@Test
    public void testCreateDeviceKeyUsingCommunityName() {
        DeviceKeyId deviceKeyId = DeviceKeyId.deviceKeyId(deviceKeyIdValue);

        DeviceKey deviceKey = DeviceKey.createDeviceKeyUsingCommunityName(deviceKeyId,
                                                                          deviceKeyLabel, deviceKeySnmpName);
        assertNotNull("The deviceKey should not be null.", deviceKey);
        assertEquals("The deviceKeyId should match as expected", deviceKeyId, deviceKey.deviceKeyId());
        assertEquals("The label should match as expected", deviceKeyLabel, deviceKey.label());
        assertEquals("The type should match as expected", DeviceKey.Type.COMMUNITY_NAME, deviceKey.type());

        CommunityName communityName = deviceKey.asCommunityName();
        assertNotNull("The communityName should not be null.", communityName);
        assertEquals("The name should match as expected", deviceKeySnmpName, communityName.name());
    }