Gets a filtered version of the SyndFeed that only has entries that were changed in the last
setSyndFeed() call.

@return
772148
@Override
    public synchronized SyndFeed getSyndFeed() {
        try {
            final SyndFeed feed = (SyndFeed) super.getSyndFeed().clone();

            final List<SyndEntry> changedEntries = new ArrayList<SyndEntry>();

            final List<SyndEntry> entries = feed.getEntries();
            for (final SyndEntry entry : entries) {
                if (changedMap.containsKey(entry.getUri())) {
                    changedEntries.add(entry);
                }
            }

            feed.setEntries(changedEntries);

            return feed;
        } catch (final CloneNotSupportedException ex) {
            throw new RuntimeException(ex);
        }
    }
442419
private ZapMenuItem getMenuToolsFilter() {
		if (menuToolsFilter == null) {
			menuToolsFilter = new ZapMenuItem("menu.tools.filter");
			menuToolsFilter.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {    

					FilterDialog dialog = new FilterDialog(getView().getMainFrame());
				    dialog.setAllFilters(filterFactory.getAllFilter());
				    dialog.showDialog(false);

					boolean startThread = false;
					for (Filter filter : filterFactory.getAllFilter()) {
						if (filter.isEnabled()) {
							startThread = true;
							break;
						}
					}

					if (startThread) {
						if (timerFilterThread == null) {
							timerFilterThread = new TimerFilterThread(filterFactory.getAllFilter());
							timerFilterThread.start();
						}
					} else if (timerFilterThread != null) {
						timerFilterThread.setStopped();
						timerFilterThread = null;
					}
				}
			});

		}
		return menuToolsFilter;
	}
145237
private static Collection<Container> keepOnlyLastIndexedContainer(Collection<Container> existingContainers, final String partiallyApplied) {

        Collection<Container> result = new ArrayList<>(existingContainers);

        // No index place holder, so nothing to filters
        if (!partiallyApplied.contains(INDEX_PLACEHOLDER)) {
            return result;
        }

        Map<String,Container> containerMap = existingContainers.stream().collect(Collectors.toMap(Container::getName, Function.identity()));

        Container last = null;
        for (long i = 1; i < Long.MAX_VALUE; i++) {
            final String withIndexApplied = partiallyApplied.replaceAll(INDEX_PLACEHOLDER, String.valueOf(i));
            Container mapped = containerMap.get(withIndexApplied);
            if (mapped != null) {
                result.remove(mapped);
                last = mapped;
            } else {
                // Readd last one removed (if any)
                if (last != null) {
                    result.add(last);
                }
                return result;
            }
        }
        throw new IllegalStateException("Internal error: Cannot find a free container index slot in " + existingContainers);
    }
1189459
@Override
    public CompletableFuture<List<Map.Entry<UUID, Long>>> getNext() {
        return this.indexIterator
                .getNext()
                .thenApply(this::mix);
    }
87127
public List<Member> getChangedMembers()
    {
        return changedPermHolders.stream()
                .filter(p -> p instanceof Member)
                .map(Member.class::cast)
                .collect(Collectors.toList());
    }
1313621
private List<FilterChangeListener> getAllListeners() {
        @SuppressWarnings("deprecation") final List<FilterChangeListener> globalChangeListeners =
                getAnalysisJobBuilder().getFilterChangeListeners();
        final List<FilterChangeListener> list =
                new ArrayList<>(globalChangeListeners.size() + _localChangeListeners.size());
        list.addAll(globalChangeListeners);
        list.addAll(_localChangeListeners);
        return list;
    }
1359235
public Set<Filter> getFilters() {
        modificationLock.readLock().lock();
        try {
            return new HashSet<>(filters);
        } finally {
            modificationLock.readLock().unlock();
        }
    }
304204
@Override
    public WireFeed createRealFeed(final SyndFeed syndFeed) {

        final List<SyndEntry> entries = Collections.synchronizedList(syndFeed.getEntries());

        final HashMap<String, Outline> entriesByNode = new HashMap<String, Outline>();

        // this will hold entries that we can't parent the first time.
        final ArrayList<OutlineHolder> doAfterPass = new ArrayList<OutlineHolder>();

        // this holds root level outlines;
        final ArrayList<Outline> root = new ArrayList<Outline>();

        for (int i = 0; i < entries.size(); i++) {
            final SyndEntry entry = entries.get(i);
            final Outline o = new Outline();

            final List<SyndCategory> cats = Collections.synchronizedList(entry.getCategories());
            boolean parentFound = false;
            final StringBuffer category = new StringBuffer();

            for (int j = 0; j < cats.size(); j++) {
                final SyndCategory cat = cats.get(j);

                if (cat.getTaxonomyUri() != null && cat.getTaxonomyUri().equals(URI_TREE)) {
                    final String nodeVal = cat.getName().substring(cat.getName().lastIndexOf("."), cat.getName().length());

                    if (cat.getName().startsWith("node.")) {
                        entriesByNode.put(nodeVal, o);
                    } else if (cat.getName().startsWith("parent.")) {
                        parentFound = true;

                        final Outline parent = entriesByNode.get(nodeVal);

                        if (parent != null) {
                            parent.getChildren().add(o);
                        } else {
                            doAfterPass.add(new OutlineHolder(o, nodeVal));
                        }
                    }
                } else if (cat.getTaxonomyUri() != null && cat.getTaxonomyUri().startsWith(URI_ATTRIBUTE)) {
                    final String name = cat.getTaxonomyUri().substring(cat.getTaxonomyUri().indexOf("#") + 1, cat.getTaxonomyUri().length());
                    o.getAttributes().add(new Attribute(name, cat.getName()));
                } else {
                    if (category.length() > 0) {
                        category.append(", ");
                    }

                    category.append(cat.getName());
                }
            }

            if (!parentFound) {
                root.add(o);
            }

            if (category.length() > 0) {
                o.getAttributes().add(new Attribute("category", category.toString()));
            }

            final List<SyndLink> links = Collections.synchronizedList(entry.getLinks());
            // final String entryLink = entry.getLink();

            for (int j = 0; j < links.size(); j++) {
                final SyndLink link = links.get(j);

                // if(link.getHref().equals(entryLink)) {
                if (link.getType() != null && link.getRel() != null && link.getRel().equals("alternate")
                        && (link.getType().equals("application/rss+xml") || link.getType().equals("application/atom+xml"))) {
                    o.setType("rss");

                    if (o.getXmlUrl() == null) {
                        o.getAttributes().add(new Attribute("xmlUrl", link.getHref()));
                    }
                } else if (link.getType() != null && link.getType().equals("text/html")) {
                    if (o.getHtmlUrl() == null) {
                        o.getAttributes().add(new Attribute("htmlUrl", link.getHref()));
                    }
                } else {
                    o.setType(link.getType());
                }

                // }
            }

            if (o.getType() == null || o.getType().equals("link")) {
                o.setText(entry.getTitle());

            } else {
                o.setTitle(entry.getTitle());
            }

            if (o.getText() == null && entry.getDescription() != null) {
                o.setText(entry.getDescription().getValue());
            }
        }

        // Do back and parenting for things we missed.
        for (int i = 0; i < doAfterPass.size(); i++) {
            final OutlineHolder o = doAfterPass.get(i);
            final Outline parent = entriesByNode.get(o.parent);

            if (parent == null) {
                root.add(o.outline);
                LOG.warn("Unable to find parent node: {}", o.parent);
            } else {
                parent.getChildren().add(o.outline);
            }
        }

        final Opml opml = new Opml();
        opml.setFeedType(getType());
        opml.setCreated(syndFeed.getPublishedDate());
        opml.setTitle(syndFeed.getTitle());

        final List<SyndPerson> authors = Collections.synchronizedList(syndFeed.getAuthors());

        for (int i = 0; i < authors.size(); i++) {
            final SyndPerson p = authors.get(i);

            if (syndFeed.getAuthor() == null || syndFeed.getAuthor().equals(p.getName())) {
                opml.setOwnerName(p.getName());
                opml.setOwnerEmail(p.getEmail());
                opml.setOwnerId(p.getUri());
            }
        }

        opml.setOutlines(root);

        return opml;
    }
499014
public static synchronized String getNewId() {
		// unique across JVMs as long as each has a different workerID
		// based on Twitter's Snowflake algorithm
		long timestamp = timestamp();

		if (lastTimestamp == timestamp) {
			sequence = (sequence + 1) & SEQUENCE_MASK;
			if (sequence == 0) {
				timestamp = tilNextMillis(lastTimestamp);
			}
		} else {
			sequence = 0;
		}

		if (timestamp < lastTimestamp) {
			throw new IllegalStateException(String.format("Clock moved backwards.  "
					+ "Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
		}

		lastTimestamp = timestamp;
		return Long.toString(((timestamp - TIMER_OFFSET) << TIMESTAMP_LEFT_SHIFT) |
											(dataCenterId << DATACENTER_ID_SHIFT) |
													(workerId << WORKER_ID_SHIFT) |
																	(sequence));

	}
1017616
public Optional<FilterList> getCurrentFilterList() {
    if (filterListStack.isEmpty()) {
      return Optional.absent();
    }
    return Optional.of(filterListStack.peek());
  }
596662
private CompressedISPNChangesBuffer getChangesBufferSafe()
   {
      CompressedISPNChangesBuffer changesContainer = changesList.get();
      if (changesContainer == null)
      {
         throw new IllegalStateException("changesContainer should not be empty");
      }
      return changesContainer;
   }
18756
public CmsRelationFilter filterWeak() {

        CmsRelationFilter filter = (CmsRelationFilter)clone();
        if (filter.m_types.isEmpty()) {
            filter.m_types.addAll(CmsRelationType.getAllWeak());
        } else {
            filter.m_types = new HashSet<CmsRelationType>(CmsRelationType.filterWeak(filter.m_types));
        }
        return filter;
    }
738922
public ReplicationFilter compilePushReplicationFilter() {
        if (isPull())
            return null;

        if (filterName != null)
            return db.getFilter(filterName);
        else if (documentIDs != null && documentIDs.size() > 0) {
            final List<String> docIDs = documentIDs;
            return new ReplicationFilter() {
                @Override
                public boolean filter(SavedRevision revision, Map<String, Object> params) {
                    return docIDs.contains(revision.getDocument().getId());
                }
            };
        }
        return null;
    }
1057109
public function onlyDiff()
    {
        return $this->filter(function (RequestEntity $request) {
            return ($request->notExists() || $request->isDirty()) && $request->notMarkedToDelete();
        });
    }
319234
@Override
    public List<Pair<Long, String>> getLastNRegisteredInstances() {
        List<Pair<Long, String>> list = new ArrayList<Pair<Long, String>>();

        synchronized (recentRegisteredQueue) {
            for (Pair<Long, String> aRecentRegisteredQueue : recentRegisteredQueue) {
                list.add(aRecentRegisteredQueue);
            }
        }
        Collections.reverse(list);
        return list;
    }
1163713
@JmxGetter(name = "lastSwapped", description = "Time in milliseconds since the store was swapped")
    public long getLastSwapped() {
        long timeSinceLastSwap = System.currentTimeMillis() - lastSwapped;
        return timeSinceLastSwap > 0 ? timeSinceLastSwap : 0;
    }
784125
public final Set<FilterEntry<T>> getFilterEntrys() {
        HashSet<FilterEntry<T>> set = new HashSet<>();
        set.addAll(entrys);
        if (ors != null) ors.forEach(f -> set.addAll(f.getFilterEntrys()));
        if (ands != null) ands.forEach(f -> set.addAll(f.getFilterEntrys()));
        return set;
    }