Advanced Java class examples