/// <summary>
        /// Restores <see cref="T" /> by deserializing the given file.
        /// </summary>
        /// <param name="fileName"> Name of the file to deserialize. The file must exist. </param>
        /// <returns> Returns <typeparamref name="T" /> as deserialized or default. </returns>
        public T DeserializeFromFile(string fileName)
        {
            if (!File.Exists(fileName))
            {
                return(GenericUtils.CreateDefaultInstance <T>());
            }

            using (var fileStream = File.OpenRead(fileName))
            {
                var dataContractSerializer = new DataContractSerializer(typeof(T));

                return((T)dataContractSerializer.ReadObject(fileStream));
            }
        }