List of usage examples for java.util NavigableSet removeIf
default boolean removeIf(Predicate<? super E> filter)
From source file:com.ejisto.modules.dao.local.LocalMockedFieldsDao.java
private MockedField saveField(MockedField field, boolean update) { MockedField newField = cloneField(field); NavigableSet<MockedFieldContainer> container; Optional<NavigableSet<MockedFieldContainer>> result = getDatabase().getMockedFields(field.getContextPath()); if (!result.isPresent()) { getDatabase().registerContextPath(field.getContextPath()); container = getDatabase().getMockedFields(field.getContextPath()) .orElseThrow(IllegalStateException::new); } else {/*from ww w .j a v a 2s . c o m*/ container = result.get(); } if (update) { container.removeIf(c -> c.wraps(newField)); } container.add(MockedFieldContainer.from(field)); return newField; }