private TableRow rowForType(String type, Table table, Map<String, Integer> currentRowByType) {
		Integer value = currentRowByType.get(type);
		if (value == null) {
			value = 0;
		}
		currentRowByType.put(type, value + 1);
		TableRow result = null;
		if (value >= table.getRows().size()) {
			result = new TableRow();
			for (int i = 1; i <= typeToColumn.size(); i++) {
				result.addValue(i, "");
			}
			table.getRows().add(result);
		}
		else {
			result = table.getRows().get(value);
		}
		return result;
	}
Return the row to which a module of the given type should be added. Will autogrow the table if needed.
spring-xd-shell/src/main/java/org/springframework/xd/shell/command/ModuleList.java