### Question:
PaginationParams { @SuppressWarnings("checkstyle:MultipleStringLiterals") public static PaginationParams previousPage(@NonNull PagedResponse.Pagination pagination) throws IllegalArgumentException { if (pagination.getPreviousUri() == null) { return null; } try { String endingBeforeId = getQueryParameter(pagination.getPreviousUri(), ENDING_BEFORE_KEY); return copyLimitAndOrder(fromEndingBefore(endingBeforeId), pagination); } catch (Exception e) { throw new IllegalArgumentException("Malformed url", e); } }  static PaginationParams fromStartingAfter(String startingAfter); static PaginationParams fromEndingBefore(String endingBefore); @SuppressWarnings("checkstyle:MultipleStringLiterals") static PaginationParams nextPage(@NonNull PagedResponse.Pagination pagination); @SuppressWarnings("checkstyle:MultipleStringLiterals") static PaginationParams previousPage(@NonNull PagedResponse.Pagination pagination); String getStartingAfter(); void setStartingAfter(String startingAfter); String getEndingBefore(); void setEndingBefore(String endingBefore); int getLimit(); void setLimit(int limit); PageOrder getOrder(); void setOrder(PageOrder order); Map<String, String> toQueryMap();  }### Answer:
@Test public void noPreviousPageNull_ParamsNull() { PagedResponse.Pagination pagination = new PagedResponse.Pagination(); PaginationParams paginationParams = PaginationParams.previousPage(pagination); assertThat(paginationParams).isNull(); }
@Test(expected = IllegalArgumentException.class) public void noPreviousPage_previousIdNotProvided_ExceptionThrown() { PagedResponse.Pagination pagination = new PagedResponse.Pagination(); pagination.setPreviousUri("/path"); PaginationParams.previousPage(pagination); Assertions.fail("Should throw an " + IllegalArgumentException.class); }