MediaService { public Completable timeline(HttpUrl url, long queueItemId, String trackKey, String trackRatingKey, String state, long duration, long time) { return api.get(url.newBuilder() .addPathSegments(":/timeline") .addQueryParameter("playQueueItemID", String.valueOf(queueItemId)) .addQueryParameter("key", trackKey) .addQueryParameter("ratingKey", trackRatingKey) .addQueryParameter("state", state) .addQueryParameter("duration", String.valueOf(duration)) .addQueryParameter("time", String.valueOf(time)) .build()) .ignoreElements(); } MediaService(Api api); Observable<MediaContainer> sections(HttpUrl url); Observable<MediaContainer> albums(HttpUrl url, String artistKey); Observable<MediaContainer> tracks(HttpUrl url, String albumKey); Observable<MediaContainer> popularTracks(HttpUrl url, String libKey, String artistKey); Observable<MediaContainer> browse(HttpUrl url, String libKey, String mediaKey,
                                           int offset); Observable<MediaContainer> recentArtists(HttpUrl url, String libKey); Observable<MediaContainer> firstCharacter(HttpUrl url, String libKey, String mediaKey); Completable timeline(HttpUrl url, long queueItemId, String trackKey, String trackRatingKey,
                              String state, long duration, long time); Single<MediaContainer> playQueue(HttpUrl url, String trackKey, String trackParentKey,
                                          String libraryId);  }
@Test public void timeline() { media.timeline(URL, 123L, "trackKey", "trackRatingKey", "playing", 300000L, 10000L); assertThat(api.actual, is("https: "&key=trackKey&ratingKey=trackRatingKey&state=playing&duration=300000&time=10000")); }