URLEncoder2 { @NonNull public static String encode(@NonNull String s, @NonNull String enc) throws UnsupportedEncodingException { return encode(s, Charset.forName(enc)); } private  URLEncoder2(); @NonNull static String encode(@NonNull String s, @NonNull String enc); @NonNull static String encode(@NonNull String s, @NonNull Charset charset); @NonNull static StringBuilder encode(@NonNull StringBuilder out, @NonNull CharSequence s, @NonNull Charset charset);  }
@Test public void testEncoders() throws UnsupportedEncodingException { Assert.assertEquals(URLEncoder.encode(EX1_SRC, StandardCharsets.UTF_8.name()), URLEncoder2.encode(EX1_SRC, StandardCharsets.UTF_8)); }
@Test(expected = NullPointerException.class) public void testStringBuilderNull() { URLEncoder2.encode(null, EX1_SRC, StandardCharsets.UTF_8); }
@Test(expected = NullPointerException.class) public void testCharSequenceNull() { URLEncoder2.encode(new StringBuilder(), null, StandardCharsets.UTF_8); }
@Test(expected = NullPointerException.class) public void testCharsetNull() { URLEncoder2.encode(new StringBuilder(), EX1_SRC, null); }