import java.util.List; class Some { public static void appendTokenTypes(StringBuilder sb, List tokenTypes) { for (int count = 0, line = 0, size = tokenTypes.size(); count < size; count++) { boolean newLine = count == 2 || line > 0 && (count - 2) % 6 == 0; newLine &= (size - count) > 2; } } }