a java-like collection framework in javascript