public override T getAttribute <T>(AttributeType <T> type)
 {
     return(findAttribute(type).orElseThrow(() => new System.ArgumentException(Messages.format("Attribute not found for type '{}'", type))));
 }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Override @SuppressWarnings("unchecked") public <T> java.util.Optional<T> findAttribute(AttributeType<T> type)
        public Optional <T> findAttribute <T>(AttributeType <T> type)
        {
            return(Optional.ofNullable((T)attributes.get(type)));
        }