@Override
    public List<Element> deserialize(final JsonElement json, final Type typeOfT, final JsonDeserializationContext context) throws JsonParseException {
        final List<Element> elements = new ArrayList<>();
        if (json.isJsonArray()) {
            final JsonArray jsonArray = json.getAsJsonArray();
            for (int i = 0; i < jsonArray.size(); i++) {
                final JsonObject jsonObject = jsonArray.get(i).getAsJsonObject();
                final int location = Integer.parseInt(jsonObject.get("location").getAsString(), 16);
                final List<MeshModel> models = deserializeModels(context, jsonObject);
                final Element element;
                if (jsonObject.has("name")) {
                    final String name = jsonObject.get("name").getAsString();
                    element = new Element(location, populateModels(models));
                    element.setName(name);
                } else {
                    element = new Element(location, populateModels(models));
                }
                elements.add(element);
            }
        }
        return elements;
    }
Class for de-serializing a list of elements stored in the Mesh Configuration Database
mesh/src/main/java/no/nordicsemi/android/mesh/transport/InternalElementListDeserializer.java