code: public Friend getFriend(Filter<Friend> filter) {
  		for (final RosterEntry e : connection.getRoster().getEntries()) {
  			final Friend f = new Friend(this, connection, e);
  			if (filter.accept(f)) {
  				return f;
  			}
  		}
  		return null;
  	}
docs: Gets a friend based on a given filter.
  
  @param filter
  The filter defines conditions that your Friend must meet.
  @return The first Friend that meets the conditions or null if not found.