ListGroupItemPresenter implements ListGroupItemView.Presenter { @Override public void selectProperty(String factName, List<String> propertyParts) { final ListGroupItemView instanceListGroupItemView = listGroupItemViewMap.get(factName); if (!instanceListGroupItemView.isShown()) { onToggleRowExpansion(instanceListGroupItemView, false); } String key; for (int i = 1; i < propertyParts.size(); i++) { String subPart = String.join(".", propertyParts.subList(0, i)); key = factName + "." + subPart; final ListGroupItemView subListGroupItemView = listGroupItemViewMap.get(key); if (subListGroupItemView != null && !subListGroupItemView.isShown()) { onToggleRowExpansion(subListGroupItemView, false); } } key = factName + "." + String.join(".", propertyParts); if (fieldItemPresenter.fieldItemMap.containsKey(key)) { fieldItemPresenter.fieldItemMap.get(key).onFieldElementSelected(); } else { instanceListGroupItemView.showCheck(true); } }  @Override void enable(); @Override void enable(String filterTerm); @Override void unselectAll(); @Override void showAll(); @Override void selectProperty(String factName, List<String> propertyParts); @Override void hideProperty(String factName, List<String> propertyParts); @Override boolean isInstanceAssigned(String factName); @Override void setInstanceAssigned(String factName, boolean assigned); @Override void disable(); @Override void init(TestToolsView.Presenter testToolsPresenter); @Override DivElement getDivElement(String factName, FactModelTree factModelTree); @Override DivElement getDivElement(String fullPath, String factName, String factModelTreeClass); @Override void onToggleRowExpansion(ListGroupItemView listGroupItemView, boolean currentlyShown); @Override void onSelectedElement(ListGroupItemView selected); @Override void onSelectedElement(FieldItemView selected); @Override void reset(); @Override String getFilterTerm();  }
@Test public void testSelectPropertyNoFieldAvailableJustExpression() { final String instance = "Applicant"; final String property = "expression"; when(listGroupItemViewMapMock.get(instance)).thenReturn(listGroupItemViewMock); fieldItemPresenterSpy.fieldItemMap = Collections.emptyMap(); listGroupItemPresenter.selectProperty(instance, Collections.singletonList(property)); verify(listGroupItemViewMock).showCheck(true); }