public void testClose() throws Exception {
  byte[] data=new byte[]{-127,-100,-50,-10,-1,0,1,10,50,127};
  TestInputStream tis=new TestInputStream(data);
  CipherInputStream cis=new CipherInputStream(tis,new NullCipher());
  cis.close();
  assertTrue("The close() method should call the close() method " + "of its underlying input stream.",tis.wasClosed());
}

public void testClose ( ) throws Exception { byte [ ] data = new byte [ ] { - 127 , - 100 , - 50 , - 10 , - 1 , 0 , 1 , 10 , 50 , 127 } ; TestInputStream tis = new TestInputStream ( data ) ; CipherInputStream cis = new CipherInputStream ( tis , new NullCipher ( ) ) ; cis . close ( ) ; assertTrue ( "The close() method should call the close() method " + "of its underlying input stream." , tis . wasClosed ( ) ) ; }
close ( ) method testing . tests that the method calls the close ( ) method of the underlying input stream .
