boolean (Component checkedComponent) { if (checkedComponent == component) return false; XmlElement element = checkedComponent.getXmlElement(); if (element != null && element.getTextOffset() >= componentTextOffset) return false; // do not check after component's offset if (componentLevelsEqual(component, checkedComponent)) { if (componentInterfaceClass.equals(checkedComponent.getInterfaceClass().getValue())) { if (component instanceof Component.Module) { if (componentType == null) { componentType = getComponentType(component); } String checkedComponentType = getComponentType(checkedComponent); return Objects.equals(componentType, checkedComponentType); } return true; } } return false; }