class RestImpl {

    void getRoomMembers(String roomId,
                        BaseRoom.RoomType roomType,
                        int offset,
                        BaseUser.SortBy sortBy,
                        Sort sort,
                        final PaginatedCallback<User> callback) {
        checkNotNull(roomId, "roomId == null");
        checkNotNull(roomType, "roomType == null");
        checkNotNull(sortBy, "sortBy == null");
        checkNotNull(sort, "sort == null");
        checkNotNull(callback, "callback == null");

        HttpUrl httpUrl = requestUrl(baseUrl, getRestApiMethodNameByRoomType(roomType, "members"))
                .addQueryParameter("roomId", roomId)
                .addQueryParameter("offset", String.valueOf(offset))
                // TODO add the sort on the query parameter. Track the status here: 
                //.addQueryParameter("sort", "{\"" + sortBy.getPropertyName() + "\":" + sort.getDirection() + "}")
                .build();

        Request request = requestBuilder(httpUrl)
                .get()
                .build();

        client.newCall(request).enqueue(new okhttp3.Callback() {
            @Override
            public void onFailure(Call call, IOException e) {
                callback.onError(new RocketChatNetworkErrorException("Network error", e));
            }

            @Override
            public void onResponse(Call call, Response response) throws IOException {
                if (!response.isSuccessful()) {
                    logger.info("Response = " + response.body().string());
                    processCallbackError(response, ERROR_HANDLER(callback));
                    return;
                }
                try {
                    JSONObject json = new JSONObject(response.body().string());
                    logger.info("Response = " + json.toString());

                    Type type = Types.newParameterizedType(List.class, User.class);
                    JsonAdapter<List<User>> adapter = moshi.adapter(type);
                    List<User> userList = adapter.fromJson(json.getJSONArray("members").toString());

                    callback.onSuccess(userList, json.optInt("total"));
                } catch (JSONException e) {
                    callback.onError(new RocketChatInvalidResponseException(e.getMessage(), e));
                }
            }
        });
    }

      RestImpl(OkHttpClient client, Moshi moshi, HttpUrl baseUrl, TokenProvider tokenProvider, Logger logger);

}