I noticed recently something that could qualify as an anti\npattern (it's an instance of "designing for the future"). Please\ncomment.\n\nI have a class which is not constrained by any interface. It has\na method which returns an InputStream. The implementation of the\nclass always returns a ByteArrayInputStream. Because the\ndesigner of the class does not let me know the full capabilities\nof the returned object I have to treat the returned object as a\nplain InputStream and cannot take advantage of the information\nthat comes with a ByteArrayInputStream (mainly the available()\nmethod).\n\nBecause of this I either have to use a lot of instanceof or end\nup with an inefficient solution.\n\nThe designer of the class prepared for the situation where his\nown implementation changes. The implementation never changed.\nPoorly performing code resulted.