### Question:
ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(reportUnitUri) .addPath("options") .build() .resolve(mNetworkClient.getBaseUrl()); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .get() .url(url) .build(); Response response = mNetworkClient.makeCall(request); try { ReportOptionSet reportOptionSet = mNetworkClient.deserializeJson(response, ReportOptionSet.class); return Collections.unmodifiableSet(reportOptionSet.get()); } catch (JsonSyntaxException ex) { return Collections.emptySet(); } } ReportOptionRestApi(NetworkClient networkClient); @NotNull Set<ReportOptionEntity> requestReportOptionsList(
            @NotNull String reportUnitUri); @NotNull ReportOptionEntity createReportOption(
            @NotNull String reportUnitUri,
            @NotNull String optionLabel,
            @NotNull List<ReportParameter> parameters,
            boolean overwrite); void updateReportOption(
            @NotNull String reportUnitUri,
            @NotNull String optionId,
            @NotNull List<ReportParameter> parameters); void deleteReportOption(
            @Nullable String reportUnitUri,
            @Nullable String optionId);  }### Answer:
@Test public void requestReportOptionsListShouldNotAllowNullReportUnitUri() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Report uri should not be null"); restApiUnderTest.requestReportOptionsList(null); }
@Test public void apiShouldListReportOptions() throws Exception { MockResponse mockResponse = MockResponseFactory.create200().setBody(reportOptionsList.asString()); mWebMockRule.enqueue(mockResponse); Set<ReportOptionEntity> response = restApiUnderTest.requestReportOptionsList("/any/uri"); assertThat(response, is(not(empty()))); RecordedRequest request = mWebMockRule.get().takeRequest(); assertThat(request.getPath(), is("/rest_v2/reports/any/uri/options")); }
@Test public void requestReportOptionsListShouldThrow500Error() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.requestReportOptionsList("any_id"); }