test_class.declarator: polygonDecoder = new PolygonDecoder()
test_class.modifier: private
test_class.original_string: private PolygonDecoder polygonDecoder = new PolygonDecoder();
test_class.type: PolygonDecoder
test_class.var_name: polygonDecoder
test_class.file: proto/src/test/java/openlr/proto/decoder/PolygonDecoderTest.java
test_class.identifier: PolygonDecoderTest
test_case.body: @Test
      public void testValidLocationReference() throws PhysicalFormatException {
          Coordinates first = Coordinates.newBuilder()
                  .setLongitude(-122.915)
                  .setLatitude(39.045)
                  .build();
  
          Coordinates second = Coordinates.newBuilder()
                  .setLongitude(-122.914)
                  .setLatitude(39.046)
                  .build();
  
          Coordinates third = Coordinates.newBuilder()
                  .setLongitude(-122.913)
                  .setLatitude(39.047)
                  .build();
  
          PolygonLocationReference polygonLocationReference = PolygonLocationReference.newBuilder()
                  .addCoordinates(first)
                  .addCoordinates(second)
                  .addCoordinates(third)
                  .build();
  
          LocationReferenceData locationReferenceData = LocationReferenceData.newBuilder()
                  .setPolygonLocationReference(polygonLocationReference)
                  .build();
  
          RawLocationReference rawLocationReference = polygonDecoder.decode("1", locationReferenceData);
  
          assertNotNull(rawLocationReference);
          assertEquals("1", rawLocationReference.getID());
          assertEquals(LocationType.POLYGON, rawLocationReference.getLocationType());
  
          List<GeoCoordinates> cornerPoints = rawLocationReference.getCornerPoints();
          assertNotNull(cornerPoints);
          assertEquals(cornerPoints.size(), 3);
  
          GeoCoordinates firstCornerPoint = cornerPoints.get(0);
          assertNotNull(firstCornerPoint);
          assertEquals(firstCornerPoint.getLongitudeDeg(), -122.915);
          assertEquals(firstCornerPoint.getLatitudeDeg(), 39.045);
  
          GeoCoordinates secondCornerPoint = cornerPoints.get(1);
          assertNotNull(secondCornerPoint);
          assertEquals(secondCornerPoint.getLongitudeDeg(), -122.914);
          assertEquals(secondCornerPoint.getLatitudeDeg(), 39.046);
  
          GeoCoordinates thirdCornerPoint = cornerPoints.get(2);
          assertNotNull(thirdCornerPoint);
          assertEquals(thirdCornerPoint.getLongitudeDeg(), -122.913);
          assertEquals(thirdCornerPoint.getLatitudeDeg(), 39.047);
      }
test_case.class_method_signature: PolygonDecoderTest.testValidLocationReference()
test_case.full_signature: @Test public void testValidLocationReference()
test_case.identifier: testValidLocationReference
test_case.invocations: build setLatitude setLongitude newBuilder build setLatitude setLongitude newBuilder build setLatitude setLongitude newBuilder build addCoordinates addCoordinates addCoordinates newBuilder build setPolygonLocationReference newBuilder decode assertNotNull assertEquals getID assertEquals getLocationType getCornerPoints assertNotNull assertEquals size get assertNotNull assertEquals getLongitudeDeg assertEquals getLatitudeDeg get assertNotNull assertEquals getLongitudeDeg assertEquals getLatitudeDeg get assertNotNull assertEquals getLongitudeDeg assertEquals getLatitudeDeg
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testValidLocationReference()
focal_class.file: proto/src/main/java/openlr/proto/decoder/PolygonDecoder.java
focal_class.identifier: PolygonDecoder
focal_class.interfaces: implements LocationReferenceDecoder
focal_class.class_method_signature: PolygonDecoder.decode(String id, LocationReferenceData data)
focal_class.full_signature: @Override public RawLocationReference decode(String id, LocationReferenceData data)
focal_class.identifier: decode
focal_class.modifiers: @Override public
focal_class.parameters: (String id, LocationReferenceData data)
focal_class.return: RawLocationReference
focal_class.signature: RawLocationReference decode(String id, LocationReferenceData data)
focal_method.body: @Override
      public RawLocationReference decode(String id, LocationReferenceData data) throws OpenLRProtoException {
          if (!data.hasPolygonLocationReference()) {
              throw new OpenLRProtoException(OpenLRProtoStatusCode.MISSING_LOCATION_REFERENCE);
          }
  
          PolygonLocationReference polygonLocationReference = data.getPolygonLocationReference();
  
          if (polygonLocationReference.getCoordinatesCount() == 0) {
              throw new OpenLRProtoException(OpenLRProtoStatusCode.INVALID_LOCATION_REFERENCE);
          }
  
          List<GeoCoordinates> cornerPoints = new ArrayList<>();
  
          for (Coordinates coordinates : polygonLocationReference.getCoordinatesList()) {
              GeoCoordinatesProtoImpl cornerPoint = new GeoCoordinatesProtoImpl(coordinates.getLongitude(), coordinates.getLatitude());
              cornerPoints.add(cornerPoint);
          }
  
          return new RawPolygonLocRef(id, cornerPoints);
      }
focal_method.class_method_signature: PolygonDecoder.decode(String id, LocationReferenceData data)
focal_method.full_signature: @Override public RawLocationReference decode(String id, LocationReferenceData data)
focal_method.identifier: decode
focal_method.invocations: hasPolygonLocationReference getPolygonLocationReference getCoordinatesCount getCoordinatesList getLongitude getLatitude add
focal_method.modifiers: @Override public
focal_method.parameters: (String id, LocationReferenceData data)
focal_method.return: RawLocationReference
focal_method.signature: RawLocationReference decode(String id, LocationReferenceData data)