String (int n, int nLines) { return IntStream.range(0, n) .mapToObj(i -> " String codeBlock" + i + " = ") .map(decl -> decl + "\"\"\"\n" + String.join("\n", Collections.nCopies(nLines, " 0")) + "\n \"\"\";") .collect(Collectors.joining("\n")); }