### Question:
Api2UrlService { public String getApi2BaseUrl() { if (StringUtils.isEmpty(api2BaseUrl)) { return API_BASEURL; } return api2BaseUrl; } Api2UrlService(String portalBaseUrl, String api2BaseUrl, String apikeyValidateUrl, String apiGatewayBaseUrl); static Api2UrlService getBeanInstance(); String getPortalBaseUrl(); String getApi2BaseUrl(); String getApikeyValidateUrl(); String getRecordPortalUrl(String collectionId, String itemId); String getApiGatewayBaseUrl(); String getRecordPortalUrl(String europeanaId); @Deprecated String getRecordResolveUrl(String europeanaId); String getRecordApi2Url(String collectionId, String itemId, String wskey); String getRecordApi2Url(String europeanaId, String wskey); String getThumbnailUrl(String uri, String type); String getThumbnailUrl(String uri, String size, String type); @Deprecated String getRedirectUrl(String wskey, String isShownAtUri, String provider, String europeanaId, String profile); static final String API_BASEURL; }### Answer:
@Test public void testGetApi2BaseUrl() { String baseUrl = null; Api2UrlService s1 = new Api2UrlService(null, baseUrl, null, null); assertEquals(Api2UrlService.API_BASEURL, s1.getApi2BaseUrl()); baseUrl = "api.europeana.eu"; Api2UrlService s2 = new Api2UrlService(null, baseUrl, null, null); assertEquals(baseUrl, s2.getApi2BaseUrl()); baseUrl = "http: Api2UrlService s3 = new Api2UrlService(null, baseUrl, null, null); assertEquals(baseUrl, s3.getApi2BaseUrl()); }