class EntityCapabilities implements Cacheable, Externalizable {

    /**
     * Identities included in these entity capabilities.
     */
    private Set<String> identities = new HashSet<>();

    /**
     * Features included in these entity capabilities.
     */
    private Set<String> features = new HashSet<>();

    /**
     * Hash string that corresponds to the entity capabilities. To be
     * regenerated and used for discovering potential poisoning of entity
     * capabilities information.
     */
    private String verAttribute;

    /**
     * The hash algorithm that was used to create the hash string.
     */
    private String hashAttribute;
    
    /**
     * Adds an identity to the entity capabilities.
     * 
     * @param identity the identity
     * @return true if the entity capabilities did not already include the
     *         identity
     */
    boolean addIdentity(String identity) {
        return identities.add(identity);
    }

    /**
     * Adds a feature to the entity capabilities.
     * 
     * @param feature the feature
     * @return true if the entity capabilities did not already include the
     *         feature
     */
    boolean addFeature(String feature) {
        return features.add(feature);
    }

    /**
     * Returns the identities of the entity capabilities.
     *
     * @return all identities.
     */
    public Set<String> getIdentities()
    {
        return identities;
    }

    /**
     * Determines whether or not a given identity is included in these entity
     * capabilities.
     * 
     * @param category the category of the identity
     * @param type the type of the identity
     * @return true if identity is included, false if not
     */
    public boolean containsIdentity(String category, String type) {
        return identities.contains(category + "/" + type);
    }

    /**
     * Returns the features of the entity capabilities.
     *
     * @return all features.
     */
    public Set<String> getFeatures()
    {
        return features;
    }

    /**
     * Determines whether or not a given feature is included in these entity
     * capabilities.
     * 
     * @param feature the feature
     * @return true if feature is included, false if not
     */
    public boolean containsFeature(String feature) {
        return features.contains(feature);
    }

    void setVerAttribute(String verAttribute) {
        this.verAttribute = verAttribute;
    }
    
    String getVerAttribute() {
        return this.verAttribute;
    }

    void setHashAttribute(String hashAttribute) {
        this.hashAttribute = hashAttribute;
    }

    String getHashAttribute() {
        return this.hashAttribute;
    }
    
    @Override
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        ExternalizableUtil.getInstance().readStrings(in, identities);
        ExternalizableUtil.getInstance().readStrings(in, features);
        verAttribute = ExternalizableUtil.getInstance().readSafeUTF(in);
    }

    @Override
    public void writeExternal(ObjectOutput out) throws IOException {
        ExternalizableUtil.getInstance().writeStrings(out, identities);
        ExternalizableUtil.getInstance().writeStrings(out, features);
        ExternalizableUtil.getInstance().writeSafeUTF(out, verAttribute);
    }

    @Override
    public int getCachedSize() throws CannotCalculateSizeException {<FILL_FUNCTION_BODY>}
}

        int size = CacheSizes.sizeOfCollection(identities);
        size += CacheSizes.sizeOfCollection(features);
        size += CacheSizes.sizeOfString(verAttribute);
        return size;
    
<no_super_class>