void (@NotNull List<ValidationInfo> info) { // clear current component errors myInfo.stream() .filter(vi -> !info.contains(vi)) .filter(vi -> vi.component != null) .map(vi -> ComponentValidator.getInstance(vi.component)) .forEach(c -> c.ifPresent(vi -> vi.updateInfo(null))); // show current errors for (ValidationInfo vi : info) { JComponent component = vi.component; if (component == null) continue; ComponentValidator validator = ComponentValidator.getInstance(component) .orElseGet(() -> new ComponentValidator(getDisposable()).installOn(component)); validator.updateInfo(vi); } }