public void test_equals() throws IOException {
    Manifest manifest1 =
        new Manifest(new URL(Support_Resources.getURL("manifest/hyts_MANIFEST.MF")).openStream());
    Manifest manifest2 =
        new Manifest(new URL(Support_Resources.getURL("manifest/hyts_MANIFEST.MF")).openStream());
    Manifest manifest3 = new Manifest();

    assertTrue(manifest1.equals(manifest1));
    assertTrue(manifest1.equals(manifest2));
    assertFalse(manifest1.equals(manifest3));
    assertFalse(manifest1.equals(this));
  }
  public void test_clone() throws IOException {
    Manifest emptyManifest = new Manifest();
    Manifest emptyClone = (Manifest) emptyManifest.clone();
    assertTrue("Should have no entries", emptyClone.getEntries().isEmpty());
    assertTrue("Should have no main attributes", emptyClone.getMainAttributes().isEmpty());
    assertEquals(emptyClone, emptyManifest);
    assertEquals(emptyManifest.clone().getClass().getName(), "java.util.jar.Manifest");

    Manifest manifest =
        new Manifest(new URL(Support_Resources.getURL("manifest/hyts_MANIFEST.MF")).openStream());
    Manifest manifestClone = (Manifest) manifest.clone();
    manifestClone.getMainAttributes();
    checkManifest(manifestClone);
  }
  public void test_writeLjava_io_OutputStream() throws IOException {
    byte b[];
    Manifest manifest1 = null;
    Manifest manifest2 = null;
    try {
      manifest1 =
          new Manifest(new URL(Support_Resources.getURL("manifest/hyts_MANIFEST.MF")).openStream());
    } catch (MalformedURLException e) {
      fail("Malformed URL");
    }

    ByteArrayOutputStream baos = new ByteArrayOutputStream();

    manifest1.write(baos);

    b = baos.toByteArray();

    File f = File.createTempFile("111", "111");
    FileOutputStream fos = new FileOutputStream(f);
    fos.close();
    try {
      manifest1.write(fos);
      fail("IOException expected");
    } catch (IOException e) {
      // expected
    }
    f.delete();

    ByteArrayInputStream bais = new ByteArrayInputStream(b);

    try {
      manifest2 = new Manifest(bais);
    } catch (MalformedURLException e) {
      fail("Malformed URL");
    }

    assertTrue(manifest1.equals(manifest2));
  }