test_class.declarator: thrown = ExpectedException.none()
test_class.modifier: @Rule
    public
test_class.original_string: @Rule
    public ExpectedException thrown = ExpectedException.none();
test_class.type: ExpectedException
test_class.var_name: thrown
test_class.file: osrm-text-instructions/libjava-osrm-instructions/src/test/java/org/project_osrm/instructions/TextInstructionsTest.java
test_class.identifier: TextInstructionsTest
test_class.superclass: extends BaseTest
test_case.body: @Test
    public void testValidDirectionFromDegree() {
      TextInstructions textInstructions = new TextInstructions("en", "v5");
      assertEquals("", textInstructions.directionFromDegree(null));
      assertEquals("north", textInstructions.directionFromDegree(0.));
      assertEquals("north", textInstructions.directionFromDegree(1.));
      assertEquals("north", textInstructions.directionFromDegree(20.));
      assertEquals("northeast", textInstructions.directionFromDegree(21.));
      assertEquals("northeast", textInstructions.directionFromDegree(69.));
      assertEquals("east", textInstructions.directionFromDegree(70.));
      assertEquals("east", textInstructions.directionFromDegree(110.));
      assertEquals("southeast", textInstructions.directionFromDegree(111.));
      assertEquals("southeast", textInstructions.directionFromDegree(159.));
      assertEquals("south", textInstructions.directionFromDegree(160.));
      assertEquals("south", textInstructions.directionFromDegree(200.));
      assertEquals("southwest", textInstructions.directionFromDegree(201.));
      assertEquals("southwest", textInstructions.directionFromDegree(249.));
      assertEquals("west", textInstructions.directionFromDegree(250.));
      assertEquals("west", textInstructions.directionFromDegree(290.));
      assertEquals("northwest", textInstructions.directionFromDegree(291.));
      assertEquals("northwest", textInstructions.directionFromDegree(339.));
      assertEquals("north", textInstructions.directionFromDegree(340.));
      assertEquals("north", textInstructions.directionFromDegree(360.));
    }
test_case.class_method_signature: TextInstructionsTest.testValidDirectionFromDegree()
test_case.full_signature: @Test public void testValidDirectionFromDegree()
test_case.identifier: testValidDirectionFromDegree
test_case.invocations: assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree assertEquals directionFromDegree
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testValidDirectionFromDegree()
focal_class.declarator: logger = Logger.getLogger(TextInstructions.class.getSimpleName())
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = Logger.getLogger(TextInstructions.class.getSimpleName());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: tokenizedInstructionHook
focal_class.modifier: private
focal_class.original_string: private TokenizedInstructionHook tokenizedInstructionHook;
focal_class.type: TokenizedInstructionHook
focal_class.var_name: tokenizedInstructionHook
focal_class.declarator: rootObject
focal_class.modifier: private
focal_class.original_string: private JsonObject rootObject;
focal_class.type: JsonObject
focal_class.var_name: rootObject
focal_class.declarator: versionObject
focal_class.modifier: private
focal_class.original_string: private JsonObject versionObject;
focal_class.type: JsonObject
focal_class.var_name: versionObject
focal_class.file: osrm-text-instructions/libjava-osrm-instructions/src/main/java/org/project_osrm/instructions/TextInstructions.java
focal_class.identifier: TextInstructions
focal_class.class_method_signature: TextInstructions.TextInstructions(String language, String version)
focal_class.full_signature: public  TextInstructions(String language, String version)
focal_class.identifier: TextInstructions
focal_class.modifiers: public
focal_class.parameters: (String language, String version)
focal_class.signature:  TextInstructions(String language, String version)
focal_class.class_method_signature: TextInstructions.getTokenizedInstructionHook()
focal_class.full_signature: public TokenizedInstructionHook getTokenizedInstructionHook()
focal_class.identifier: getTokenizedInstructionHook
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: TokenizedInstructionHook
focal_class.signature: TokenizedInstructionHook getTokenizedInstructionHook()
focal_class.class_method_signature: TextInstructions.setTokenizedInstructionHook(TokenizedInstructionHook tokenizedInstructionHook)
focal_class.full_signature: public void setTokenizedInstructionHook(TokenizedInstructionHook tokenizedInstructionHook)
focal_class.identifier: setTokenizedInstructionHook
focal_class.modifiers: public
focal_class.parameters: (TokenizedInstructionHook tokenizedInstructionHook)
focal_class.return: void
focal_class.signature: void setTokenizedInstructionHook(TokenizedInstructionHook tokenizedInstructionHook)
focal_class.class_method_signature: TextInstructions.getRootObject()
focal_class.full_signature: public JsonObject getRootObject()
focal_class.identifier: getRootObject
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: JsonObject
focal_class.signature: JsonObject getRootObject()
focal_class.class_method_signature: TextInstructions.getVersionObject()
focal_class.full_signature: public JsonObject getVersionObject()
focal_class.identifier: getVersionObject
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: JsonObject
focal_class.signature: JsonObject getVersionObject()
focal_class.class_method_signature: TextInstructions.capitalizeFirstLetter(String text)
focal_class.full_signature: public static String capitalizeFirstLetter(String text)
focal_class.identifier: capitalizeFirstLetter
focal_class.modifiers: public static
focal_class.parameters: (String text)
focal_class.return: String
focal_class.signature: String capitalizeFirstLetter(String text)
focal_class.class_method_signature: TextInstructions.ordinalize(Integer number)
focal_class.full_signature: public String ordinalize(Integer number)
focal_class.identifier: ordinalize
focal_class.modifiers: public
focal_class.parameters: (Integer number)
focal_class.return: String
focal_class.signature: String ordinalize(Integer number)
focal_class.class_method_signature: TextInstructions.directionFromDegree(Double degree)
focal_class.full_signature: public String directionFromDegree(Double degree)
focal_class.identifier: directionFromDegree
focal_class.modifiers: public
focal_class.parameters: (Double degree)
focal_class.return: String
focal_class.signature: String directionFromDegree(Double degree)
focal_class.class_method_signature: TextInstructions.laneConfig(LegStep step)
focal_class.full_signature: public String laneConfig(LegStep step)
focal_class.identifier: laneConfig
focal_class.modifiers: public
focal_class.parameters: (LegStep step)
focal_class.return: String
focal_class.signature: String laneConfig(LegStep step)
focal_class.class_method_signature: TextInstructions.compile(LegStep step)
focal_class.full_signature: public String compile(LegStep step)
focal_class.identifier: compile
focal_class.modifiers: public
focal_class.parameters: (LegStep step)
focal_class.return: String
focal_class.signature: String compile(LegStep step)
focal_method.body: public String directionFromDegree(Double degree) {
      if (degree == null) {
        // step had no bearing_after degree, ignoring
        return "";
      } else if (degree >= 0 && degree <= 20) {
        return getVersionObject().getAsJsonObject("constants").getAsJsonObject("direction")
          .getAsJsonPrimitive("north").getAsString();
      } else if (degree > 20 && degree < 70) {
        return getVersionObject().getAsJsonObject("constants").getAsJsonObject("direction")
          .getAsJsonPrimitive("northeast").getAsString();
      } else if (degree >= 70 && degree <= 110) {
        return getVersionObject().getAsJsonObject("constants").getAsJsonObject("direction")
          .getAsJsonPrimitive("east").getAsString();
      } else if (degree > 110 && degree < 160) {
        return getVersionObject().getAsJsonObject("constants").getAsJsonObject("direction")
          .getAsJsonPrimitive("southeast").getAsString();
      } else if (degree >= 160 && degree <= 200) {
        return getVersionObject().getAsJsonObject("constants").getAsJsonObject("direction")
          .getAsJsonPrimitive("south").getAsString();
      } else if (degree > 200 && degree < 250) {
        return getVersionObject().getAsJsonObject("constants").getAsJsonObject("direction")
          .getAsJsonPrimitive("southwest").getAsString();
      } else if (degree >= 250 && degree <= 290) {
        return getVersionObject().getAsJsonObject("constants").getAsJsonObject("direction")
          .getAsJsonPrimitive("west").getAsString();
      } else if (degree > 290 && degree < 340) {
        return getVersionObject().getAsJsonObject("constants").getAsJsonObject("direction")
          .getAsJsonPrimitive("northwest").getAsString();
      } else if (degree >= 340 && degree <= 360) {
        return getVersionObject().getAsJsonObject("constants").getAsJsonObject("direction")
          .getAsJsonPrimitive("north").getAsString();
      } else {
        throw new RuntimeException("Degree is invalid: " + degree);
      }
    }
focal_method.class_method_signature: TextInstructions.directionFromDegree(Double degree)
focal_method.full_signature: public String directionFromDegree(Double degree)
focal_method.identifier: directionFromDegree
focal_method.invocations: getAsString getAsJsonPrimitive getAsJsonObject getAsJsonObject getVersionObject getAsString getAsJsonPrimitive getAsJsonObject getAsJsonObject getVersionObject getAsString getAsJsonPrimitive getAsJsonObject getAsJsonObject getVersionObject getAsString getAsJsonPrimitive getAsJsonObject getAsJsonObject getVersionObject getAsString getAsJsonPrimitive getAsJsonObject getAsJsonObject getVersionObject getAsString getAsJsonPrimitive getAsJsonObject getAsJsonObject getVersionObject getAsString getAsJsonPrimitive getAsJsonObject getAsJsonObject getVersionObject getAsString getAsJsonPrimitive getAsJsonObject getAsJsonObject getVersionObject getAsString getAsJsonPrimitive getAsJsonObject getAsJsonObject getVersionObject
focal_method.modifiers: public
focal_method.parameters: (Double degree)
focal_method.return: String
focal_method.signature: String directionFromDegree(Double degree)