HttpUtils { public static String encodePathSegment(@Nonnull String pathSegment) { if (pathSegment.isEmpty()) { throw new IllegalArgumentException("Cannot provide empty path segment"); } return urlPathSegmentEscaper().escape(pathSegment); }  static String encodePathSegment(@Nonnull String pathSegment); static String encodePathSegment(@Nonnull Number pathSegment); static String encodePathSegment(@Nonnull Boolean pathSegment); static String encodePathSegment(@Nonnull Character pathSegment); static String encodePathSegment(@Nonnull UUID pathSegment); static Object attemptEncodeQueryParam(Object queryParam); static WrappedWebTarget encodeMapQueryParam(
            WrappedWebTarget target, String prefix, Map<String, ?> queryParam); static WrappedWebTarget encodeCollectionFormatQueryParam(
            WrappedWebTarget target,
            String queryParamName,
            List<T> values,
            CollectionFormatType collectionFormatType);  }
@Test(expected = IllegalArgumentException.class) public void encodePathSegment_emptyPathSegment() { HttpUtils.encodePathSegment(""); }
@Test public void encodePathSegment_string_nothingToChange() { assertEquals("foobar", HttpUtils.encodePathSegment("foobar")); }
@Test public void encodePathSegment_string() { assertEquals( "%251%253D%253F%2540%255B%255D%2541%20aaaa", HttpUtils.encodePathSegment("%1%3D%3F%40%5B%5D%41 aaaa")); }
@Test public void encodePathSegment_numbers() { assertEquals("50", HttpUtils.encodePathSegment(50)); assertEquals("112233445566", HttpUtils.encodePathSegment(112233445566L)); assertEquals("50.5", HttpUtils.encodePathSegment(50.5D)); assertEquals("100.5", HttpUtils.encodePathSegment(100.5F)); assertEquals("20", HttpUtils.encodePathSegment((short) 20)); }
@Test public void encodePathSegment_uuid() { UUID uuid = UUID.randomUUID(); assertEquals(uuid.toString(), HttpUtils.encodePathSegment(uuid)); }
@Test public void encodePathSegment_character() { assertEquals("d", HttpUtils.encodePathSegment('d')); }
@Test public void encodePathSegment_boolean() { assertEquals("true", HttpUtils.encodePathSegment(true)); }