Added main() to Hat.java