@Test
public void testGetFileName() throws Exception {

  // Make a string with some chars that are from DOS ANSI art days, these chars have different
  // binary representations in UTF8 and Cp437. We use light, medium, and dark "shade" characters
  // (0x2591, 0x2592, 0x2593 respectively) for this purpose. Go go ANSI art!
  // https://en.wikipedia.org/wiki/Code_page_437
  // https://en.wikipedia.org/wiki/Block_Elements
  String fileName = new String("\u2591\u2592\u2593AWESOME\u2593\u2592\u2591");
  byte[] utf8Bytes = fileName.getBytes("UTF8");
  byte[] cp437Bytes = fileName.getBytes("Cp437");
  Assert.assertFalse(Arrays.equals(utf8Bytes, cp437Bytes)); // For test sanity
  MinimalZipEntry utf8Entry =
      new MinimalZipEntry(
          COMPRESSION_METHOD,
          CRC32,
          COMPRESSED_SIZE,
          UNCOMPRESSED_SIZE,
          utf8Bytes,
          true /* utf8 */,
          FILE_OFFSET_OF_LOCAL_ENTRY);
  Assert.assertArrayEquals(utf8Bytes, utf8Entry.getFileNameBytes());
  String fileNameFromUtf8Bytes = utf8Entry.getFileName();
  Assert.assertEquals(fileName, fileNameFromUtf8Bytes);
  MinimalZipEntry cp437Entry =
      new MinimalZipEntry(
          COMPRESSION_METHOD,
          CRC32,
          COMPRESSED_SIZE,
          UNCOMPRESSED_SIZE,
          cp437Bytes,
          false /* cp437 */,
          FILE_OFFSET_OF_LOCAL_ENTRY);
  Assert.assertArrayEquals(cp437Bytes, cp437Entry.getFileNameBytes());
  String fileNameFromCp437Bytes = cp437Entry.getFileName();
  Assert.assertEquals(fileName, fileNameFromCp437Bytes);
}