f = new File(System.getProperty("user.dir"), "fd.tst");
f.delete();
os = new BufferedOutputStream(fos = new FileOutputStream(f
.getPath()), 4096);
FileDescriptor fd = fos.getFD();
assertTrue("Valid fd returned false", fd.valid());
os.close();
assertTrue("Invalid fd returned true", !fd.valid());
} catch (Exception e) {
fail("Exception during test : " + e.getMessage());
}