### Question:
Incidence implements Serializable { public static List<DegreeCount> parseCsv(String csvContent, String direction) { List<DegreeCount> counts = new ArrayList<>(); Scanner scanner = new Scanner(csvContent); scanner.useDelimiter(","); while (scanner.hasNextLine()) { String line = scanner.nextLine(); String[] parts = line.split(","); if (parts.length != 3) { continue; } if (direction.equals(parts[0])) { int degree = Integer.parseInt(parts[1]); long count = Long.parseLong(parts[2]); counts.add(new DegreeCount(degree, count)); } } scanner.close(); return counts; } Incidence(final QualifiedName vertexLabel,
                     final double existenceProbability,
                     final DegreeDistribution degreeDistribution);  Incidence(final QualifiedName vertexLabel,
                     final double existenceProbability,
                     final String csvContent, final String direction, final String edgeLabel); static List<DegreeCount> parseCsv(String csvContent, String direction); QualifiedName getVertexLabel(); double getExistenceProbability(); BucketedEdgeDistribution.WeightedBuckets getDegreeDistribution(int size, final Random random);  }### Answer:
@Test public void testParsingCsv() { String content = "direction,degree,count\n" + "out,1,11\n" + "out,2,22\n" + "in,1,111\n" + "in,2,222\n"; { List<Incidence.DegreeCount> counts = Incidence.parseCsv(content, "in"); assertEquals(1, counts.get(0).degree); assertEquals(111, counts.get(0).count); assertEquals(2, counts.get(1).degree); assertEquals(222, counts.get(1).count); } { List<Incidence.DegreeCount> counts = Incidence.parseCsv(content, "out"); assertEquals(1, counts.get(0).degree); assertEquals(11, counts.get(0).count); assertEquals(2, counts.get(1).degree); assertEquals(22, counts.get(1).count); } }