That so‑called Array class appears to be a List. It has been enhanced with methods which count how many instances of a particular object it contains. You can probably create such a class yourself with a List implementation like ArrayList.
Good night. Drive safely. Here's a tiny ad for the road: