@Test
    public void shouldThrowErrorWhenCharactersAreInvalid() throws IOException {
        //given
        File tmpFile = folder.newFile(FILENAME);
        FileOutputStream fileOutputStream = new FileOutputStream(tmpFile, true);
        CharsetEncoder charsetEncoder = Charset.forName(ENCODING).newEncoder();
        OutputStreamWriter writer = new OutputStreamWriter(fileOutputStream, charsetEncoder);
        //when
        try {
            writer.getEncoding();
            writer.write("45");
            writer.flush();
        } finally {
            writer.close();
        }
        String filePathString = tmpFile.getAbsolutePath();
        //then
        try {
            FileParser fileParser = new FileParser(filePathString);
            fileParser.parse();
        } catch (GOLException e) {
            String msg = "Die Datei darf nur aus 0'en und 1'sen bestehen und muss als UTF-16 encodiert sein.";
            assertEquals(msg, e.getMessage());
        }
    }