### Question:
FileObjectUtils { public static String getContentAsString(final FileObject file, final Charset charset) throws IOException { try (final FileContent content = file.getContent()) { return content.getString(charset); } } private  FileObjectUtils(); static boolean exists(final FileObject fileObject); static AbstractFileObject getAbstractFileObject(final FileObject fileObject); static byte[] getContentAsByteArray(final FileObject file); static String getContentAsString(final FileObject file, final Charset charset); static String getContentAsString(final FileObject file, final String charset); static boolean isInstanceOf(final FileObject fileObject, final Class<?> wantedClass); static Properties readProperties(final FileObject fileObject); static Properties readProperties(final FileObject fileObject, final Properties properties); static void writeContent(final FileObject file, final OutputStream output); static void writeContent(final FileObject srcFile, final FileObject destFile);  }### Answer:
@Test public void testgetContentAsString_Charset() throws FileSystemException, IOException { Assert.assertEquals("This is a test file.", FileObjectUtils.getContentAsString( VFS.getManager().toFileObject(new File("src/test/resources/test-data/read-tests/file1.txt")), StandardCharsets.UTF_8)); }
@Test public void testgetContentAsString_CharsetNull() throws FileSystemException, IOException { Assert.assertEquals("This is a test file.", FileObjectUtils.getContentAsString( VFS.getManager().toFileObject(new File("src/test/resources/test-data/read-tests/file1.txt")), (Charset) null)); }
@Test public void testgetContentAsString_String() throws FileSystemException, IOException { Assert.assertEquals("This is a test file.", FileObjectUtils.getContentAsString( VFS.getManager().toFileObject(new File("src/test/resources/test-data/read-tests/file1.txt")), "UTF-8")); }
@Test public void testgetContentAsString_StringNull() throws FileSystemException, IOException { Assert.assertEquals("This is a test file.", FileObjectUtils.getContentAsString( VFS.getManager().toFileObject(new File("src/test/resources/test-data/read-tests/file1.txt")), (String) null)); }