TextInstructions { public String ordinalize(Integer number) { try { return getVersionObject().getAsJsonObject("constants").getAsJsonObject("ordinalize") .getAsJsonPrimitive(String.valueOf(number)).getAsString(); } catch (Exception exception) { return ""; } } TextInstructions(String language, String version); TokenizedInstructionHook getTokenizedInstructionHook(); void setTokenizedInstructionHook(TokenizedInstructionHook tokenizedInstructionHook); JsonObject getRootObject(); JsonObject getVersionObject(); static String capitalizeFirstLetter(String text); String ordinalize(Integer number); String directionFromDegree(Double degree); String laneConfig(LegStep step); String compile(LegStep step);  }
@Test public void testOrdinalize() { TextInstructions textInstructions = new TextInstructions("en", "v5"); assertEquals("1st", textInstructions.ordinalize(1)); assertEquals("", textInstructions.ordinalize(999)); }