/// <summary> /// Finds first book with equal value of specified parameter /// </summary> /// <param name="predicate">Predicate which specifies tag by value of which book will be chosen</param> /// <param name="value">Value by which book will be chosen</param> /// <returns></returns> public Book FindBook <T>(IPredicate <T> predicate, T value) { if (predicate == null) { throw new ArgumentNullException(); } foreach (var book in Books) { if (predicate.FitsTheTag(book, value)) { return(book); } } return(null); }