code: public static HitLocations from(JsonObject locationsJson) {
          DefaultHitLocations hitLocations = new DefaultHitLocations();
          if (locationsJson == null) {
              return hitLocations;
          }
  
          for (String field : locationsJson.getNames()) {
              JsonObject termsJson = locationsJson.getObject(field);
  
              for (String term : termsJson.getNames()) {
                  JsonArray locsJson = termsJson.getArray(term);
  
                  for (int i = 0; i < locsJson.size(); i++) {
                      JsonObject loc = locsJson.getObject(i);
                      long pos = loc.getLong("pos");
                      long start = loc.getLong("start");
                      long end = loc.getLong("end");
                      JsonArray arrayPositionsJson = loc.getArray("array_positions");
                      long[] arrayPositions = null;
                      if (arrayPositionsJson != null) {
                          arrayPositions = new long[arrayPositionsJson.size()];
                          for (int j = 0; j < arrayPositionsJson.size(); j++) {
                              arrayPositions[j] = arrayPositionsJson.getLong(j);
                          }
                      }
                      hitLocations.add(new HitLocation(field, term, pos, start, end, arrayPositions));
                  }
              }
          }
          return hitLocations;
      }
docs: Parses a FTS JSON representation of a {@link HitLocations}.