### Question:
CharSources { public static CharSource ofContent(String content) { return CharSource.wrap(content); } private  CharSources(); static CharSource ofFileName(String fileName); static CharSource ofFileName(String fileName, Charset charset); static CharSource ofFile(File file); static CharSource ofFile(File file, Charset charset); static CharSource ofPath(Path path); static CharSource ofPath(Path path, Charset charset); static CharSource ofUrl(URL url); static CharSource ofUrl(URL url, Charset charset); static CharSource ofContent(String content); static CharSource ofContent(byte[] content); static CharSource ofContent(byte[] content, Charset charset);  }### Answer:
@Test public void testOfContentString() throws Exception { CharSource charSource = CharSources.ofContent("H\u0000e\u0000l\u0000l\u0000o\u0000"); assertThat(charSource.readFirstLine()).isEqualTo("H\u0000e\u0000l\u0000l\u0000o\u0000"); assertThat(charSource.length()).isEqualTo(10); }
@Test public void testOfContentByteArray() throws Exception { byte[] inputText = "H\u0000e\u0000l\u0000l\u0000o\u0000".getBytes(Charsets.UTF_8); CharSource charSource = CharSources.ofContent(inputText); assertThat(charSource.readFirstLine()).isEqualTo("H\u0000e\u0000l\u0000l\u0000o\u0000"); assertThat(charSource.length()).isEqualTo(10); }
@Test public void testOfContentByteArrayWithCharset() throws Exception { byte[] inputText = "H\u0000e\u0000l\u0000l\u0000o\u0000".getBytes(Charsets.UTF_8); CharSource charSource = CharSources.ofContent(inputText, Charsets.UTF_16LE); assertThat(charSource.readFirstLine()).isEqualTo("Hello"); assertThat(charSource.length()).isEqualTo(5); }