void (@NotNull MyBean state) { myPositivePatterns.clear(); myNegativePatterns.clear(); Set<String> removedPositive = new HashSet<>(state.removedPositive); Set<String> removedNegative = new HashSet<>(state.removedNegative); for (CustomizableConsoleFoldingBean regexp : CustomizableConsoleFoldingBean.EP_NAME.getExtensions()) { if (!(regexp.negate ? removedNegative : removedPositive).contains(regexp.substring)) { patternList(regexp.negate).add(regexp.substring); } } myPositivePatterns.addAll(filterEmptyStringsFromCollection(state.addedPositive)); myNegativePatterns.addAll(filterEmptyStringsFromCollection(state.addedNegative)); }