CollectionPresenter implements CollectionView.Presenter { protected void populateExpression(JSONValue jsonValue) { final JSONString jsonString = jsonValue.isString(); collectionView.setExpression(jsonString.stringValue()); }  @Override void initListStructure(String key, Map<String, String> simplePropertiesMap, Map<String, Map<String, String>> expandablePropertiesMap, CollectionView collectionView); @Override void initMapStructure(String key, Map<String, String> keyPropertyMap, Map<String, String> valuePropertyMap, CollectionView collectionView); @Override void setValue(String jsonString); @Override void showEditingBox(); @Override void onToggleRowExpansion(boolean isShown); @Override void updateRowExpansionStatus(boolean isShown); @Override void addListItem(Map<String, String> simplePropertiesValues, Map<String, Map<String, String>> expandablePropertiesValues); @Override void addMapItem(Map<String, String> keyPropertiesValues, Map<String, String> valuePropertiesValues); @Override void save(); @Override void remove(); @Override void toggleEditingStatus(boolean editingStatus);  }
@Test public void populateExpression() { when(jsonStringMock.stringValue()).thenReturn("test-string"); collectionEditorPresenterSpy.populateExpression(jsonValueMock); verify(collectionViewMock, times(1)).setExpression("test-string"); }