ParsedLine (@NotNull String line, int lineNumber) { int separatorIndex = nextSeparatorIndex(line, 0); NumberWithChar pair = parseNumberWithChar(line.substring(0, separatorIndex)); GraphNode graphNode = new GraphNode(lineNumber, parseGraphNodeType(pair.character)); String[] edges = line.substring(separatorIndex + 2).split("\\s"); List<String> normalEdges = ContainerUtil.mapNotNull(edges, s -> { if (s.isEmpty()) return null; return s; }); return new ParsedLine(pair.nodeId, graphNode, normalEdges); }