Browse souce code repository at: https://github.com/jjYBdx4IL/java-evaluation/blob/master/src/test/java/tests/java/nio/charset/CharsetTest.java
package tests.java.nio.charset;

import java.nio.charset.Charset;
import java.nio.charset.UnsupportedCharsetException;
import static org.junit.Assert.*;
import org.junit.Test;

/**
 *
 * @author Github jjYBdx4IL Projects
 */
public class CharsetTest {

    @Test
    public void test1() {
        try {
            Charset.forName("not-existing");
            fail();
        } catch(UnsupportedCharsetException ex) {}
    }
}
-------------------------------------------------------------------------------
Test set: tests.java.nio.charset.CharsetTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in tests.java.nio.charset.CharsetTest
test1  Time elapsed: 0 s