class ImmutableThing implements Thing {

    @Override
    @Deprecated
    public Thing setAccessControlList(final AccessControlList accessControlList) {
        if (policyId != null) {
            throw AclInvalidException.newBuilder(thingId)
                    .description("Could not set v1 ACL to Thing already containing v2 Policy")
                    .build();
        } else if (Objects.equals(acl, accessControlList)) {
            return this;
        }

        return new ImmutableThing(thingId, accessControlList, null, definition, attributes, features, lifecycle,
                revision, modified, created, metadata);
    }

    private  ImmutableThing(@Nullable final ThingId thingId,
            @Nullable final AccessControlList acl,
            @Nullable final PolicyId policyId,
            @Nullable final ThingDefinition definition,
            @Nullable final Attributes attributes,
            @Nullable final Features features,
            @Nullable final ThingLifecycle lifecycle,
            @Nullable final ThingRevision revision,
            @Nullable final Instant modified,
            @Nullable final Instant created,
            @Nullable final Metadata metadata);

}