### Question:
ComponentTypeNestedModel implements Serializable { public Map<String, ComponentType> findParents(ComponentTypeNestedModel nestedModel, String componentTypeId) { Map<String, ComponentType> componentMap = new HashMap<>(); if (nestedModel.getComponentType() != null && nestedModel.getComponentType().getComponentType().equals(componentTypeId)) { componentMap.put(nestedModel.getComponentType().getComponentType(), nestedModel.getComponentType()); } else { boolean found = false; if (nestedModel.getComponentType() != null) { componentMap.put(nestedModel.getComponentType().getComponentType(), nestedModel.getComponentType()); } found = findFirstMatchingChild(nestedModel, componentTypeId, componentMap, found); if (!found) { checkRestOfChildren(nestedModel, componentTypeId, componentMap); } } return componentMap; } @SuppressWarnings({"squid:S2637", "squid:S1186"})  ComponentTypeNestedModel(); List<String> findComponentTypeChildren(); Map<String, ComponentType> findParents(ComponentTypeNestedModel nestedModel, String componentTypeId); @Override String toString(); ComponentTypeView getComponentType(); void setComponentType(ComponentTypeView componentType); List<ComponentTypeNestedModel> getChildren(); void setChildren(List<ComponentTypeNestedModel> children);  }### Answer:
@Test public void testfindParents() { System.out.println("findParents"); ComponentTypeNestedModel instance = getData(); Map<String, ComponentType> typeMap = instance.findParents(instance, "C"); assertEquals(true, typeMap.keySet().contains("A")); assertEquals(true, typeMap.keySet().contains("B")); assertEquals(true, typeMap.keySet().contains("C")); }