test_class.declarator: baseDir = new File("target/test-output/ReportMapperTest")
test_class.modifier: private final
test_class.original_string: private final File baseDir = new File("target/test-output/ReportMapperTest");
test_class.type: File
test_class.var_name: baseDir
test_class.file: core/src/test/java/net/adamcin/oakpal/core/ReportMapperTest.java
test_class.identifier: ReportMapperTest
test_case.body: @Test
      public void testReportsToJson() throws Exception {
          final List<CheckReport> originalReports = asList(
                  new SimpleReport("test/first",
                          singletonList(
                                  new SimpleViolation(Severity.MINOR,
                                          "one",
                                          PackageId.fromString("test:first")))
                  ),
                  new SimpleReport("test/second",
                          asList(
                                  new SimpleViolation(Severity.MINOR,
                                          "one", PackageId.fromString("test:first")),
                                  new SimpleViolation(Severity.MINOR,
                                          "two",
                                          PackageId.fromString("test:first"),
                                          PackageId.fromString("test:second"))
                          )
                  )
          );
  
          final StringWriter writer = new StringWriter();
          ReportMapper.writeReports(originalReports, () -> writer);
          assertEquals("CheckReports should round trip",
                  new ArrayList<>(originalReports),
                  new ArrayList<>(ReportMapper.readReports(() -> new StringReader(writer.toString()))));
      }
test_case.class_method_signature: ReportMapperTest.testReportsToJson()
test_case.full_signature: @Test public void testReportsToJson()
test_case.identifier: testReportsToJson
test_case.invocations: asList singletonList fromString asList fromString fromString fromString writeReports assertEquals readReports toString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testReportsToJson()
focal_class.declarator: KEYS = new JsonKeys() {
          @Override
          public String reports() {
              return "reports";
          }
  
          @Override
          public String checkName() {
              return "checkName";
          }
  
          @Override
          public String violations() {
              return "violations";
          }
      }
focal_class.modifier: private static final
focal_class.original_string: private static final JsonKeys KEYS = new JsonKeys() {
          @Override
          public String reports() {
              return "reports";
          }
  
          @Override
          public String checkName() {
              return "checkName";
          }
  
          @Override
          public String violations() {
              return "violations";
          }
      };
focal_class.type: JsonKeys
focal_class.var_name: KEYS
focal_class.file: core/src/main/java/net/adamcin/oakpal/core/ReportMapper.java
focal_class.identifier: ReportMapper
focal_class.class_method_signature: ReportMapper.keys()
focal_class.full_signature: public static JsonKeys keys()
focal_class.identifier: keys
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: JsonKeys
focal_class.signature: JsonKeys keys()
focal_class.class_method_signature: ReportMapper.ReportMapper()
focal_class.full_signature: private  ReportMapper()
focal_class.identifier: ReportMapper
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  ReportMapper()
focal_class.class_method_signature: ReportMapper.readReports(final @NotNull ReaderSupplier readerSupplier)
focal_class.full_signature: public static List<CheckReport> readReports(final @NotNull ReaderSupplier readerSupplier)
focal_class.identifier: readReports
focal_class.modifiers: public static
focal_class.parameters: (final @NotNull ReaderSupplier readerSupplier)
focal_class.return: List<CheckReport>
focal_class.signature: List<CheckReport> readReports(final @NotNull ReaderSupplier readerSupplier)
focal_class.class_method_signature: ReportMapper.readReportsFromFile(final @NotNull File jsonFile)
focal_class.full_signature: public static List<CheckReport> readReportsFromFile(final @NotNull File jsonFile)
focal_class.identifier: readReportsFromFile
focal_class.modifiers: public static
focal_class.parameters: (final @NotNull File jsonFile)
focal_class.return: List<CheckReport>
focal_class.signature: List<CheckReport> readReportsFromFile(final @NotNull File jsonFile)
focal_class.class_method_signature: ReportMapper.writeReports(final @NotNull Collection<CheckReport> reports,
                                      final @NotNull WriterSupplier writerSupplier)
focal_class.full_signature: public static void writeReports(final @NotNull Collection<CheckReport> reports,
                                      final @NotNull WriterSupplier writerSupplier)
focal_class.identifier: writeReports
focal_class.modifiers: public static
focal_class.parameters: (final @NotNull Collection<CheckReport> reports,
                                      final @NotNull WriterSupplier writerSupplier)
focal_class.return: void
focal_class.signature: void writeReports(final @NotNull Collection<CheckReport> reports,
                                      final @NotNull WriterSupplier writerSupplier)
focal_class.class_method_signature: ReportMapper.writeReportsToFile(final Collection<CheckReport> reports,
                                            final @NotNull File outputFile)
focal_class.full_signature: public static void writeReportsToFile(final Collection<CheckReport> reports,
                                            final @NotNull File outputFile)
focal_class.identifier: writeReportsToFile
focal_class.modifiers: public static
focal_class.parameters: (final Collection<CheckReport> reports,
                                            final @NotNull File outputFile)
focal_class.return: void
focal_class.signature: void writeReportsToFile(final Collection<CheckReport> reports,
                                            final @NotNull File outputFile)
focal_class.class_method_signature: ReportMapper.reportFromJson(final JsonObject jsonReport)
focal_class.full_signature: static CheckReport reportFromJson(final JsonObject jsonReport)
focal_class.identifier: reportFromJson
focal_class.modifiers: static
focal_class.parameters: (final JsonObject jsonReport)
focal_class.return: CheckReport
focal_class.signature: CheckReport reportFromJson(final JsonObject jsonReport)
focal_class.class_method_signature: ReportMapper.violationFromJson(final JsonObject jsonViolation)
focal_class.full_signature: static Violation violationFromJson(final JsonObject jsonViolation)
focal_class.identifier: violationFromJson
focal_class.modifiers: static
focal_class.parameters: (final JsonObject jsonViolation)
focal_class.return: Violation
focal_class.signature: Violation violationFromJson(final JsonObject jsonViolation)
focal_class.class_method_signature: ReportMapper.reportsToJson(final @NotNull Collection<CheckReport> reports)
focal_class.full_signature: public static JsonArray reportsToJson(final @NotNull Collection<CheckReport> reports)
focal_class.identifier: reportsToJson
focal_class.modifiers: public static
focal_class.parameters: (final @NotNull Collection<CheckReport> reports)
focal_class.return: JsonArray
focal_class.signature: JsonArray reportsToJson(final @NotNull Collection<CheckReport> reports)
focal_class.class_method_signature: ReportMapper.reportsToJsonObject(final @NotNull Collection<CheckReport> reports)
focal_class.full_signature: public static JsonObject reportsToJsonObject(final @NotNull Collection<CheckReport> reports)
focal_class.identifier: reportsToJsonObject
focal_class.modifiers: public static
focal_class.parameters: (final @NotNull Collection<CheckReport> reports)
focal_class.return: JsonObject
focal_class.signature: JsonObject reportsToJsonObject(final @NotNull Collection<CheckReport> reports)
focal_method.body: public static JsonArray reportsToJson(final @NotNull Collection<CheckReport> reports) {
          return reports.stream()
                  .map(CheckReport::toJson)
                  .collect(JsonCollectors.toJsonArray());
      }
focal_method.class_method_signature: ReportMapper.reportsToJson(final @NotNull Collection<CheckReport> reports)
focal_method.full_signature: public static JsonArray reportsToJson(final @NotNull Collection<CheckReport> reports)
focal_method.identifier: reportsToJson
focal_method.invocations: collect map stream toJsonArray
focal_method.modifiers: public static
focal_method.parameters: (final @NotNull Collection<CheckReport> reports)
focal_method.return: JsonArray
focal_method.signature: JsonArray reportsToJson(final @NotNull Collection<CheckReport> reports)