public boolean collide(final Rectangle rectangle) {
        // TODO Insert code for assignment 5.2.c
        if(rectangle == null){
            throw new IllegalArgumentException("rectangle is null");
        }
        boolean flag = false;
        try{
            Set<Rectangle> rectangleSet = this.getCollisionCandidates(rectangle);
            for(Rectangle re:rectangleSet){
                if(re.intersects(rectangle)){
                    flag = true;
                }
            }
        }catch (Exception e){
            System.out.println(e.getMessage());
        }finally {
            return flag;
        }
    }
public boolean collide(final Rectangle rectangle) {
       
        if(rectangle == null){
            throw new IllegalArgumentException("rectangle is null");
        }
        boolean flag = false;
        try{
            Set<Rectangle> rectangleSet = this.getCollisionCandidates(rectangle);
            for(Rectangle re:rectangleSet){
                if(re.intersects(rectangle)){
                    flag = true;
                }
            }
        }catch (Exception e){
            System.out.println(e.getMessage());
        }finally {
            return flag;
        }
    }
public boolean collide(final rectangle rectangle) { if(rectangle == null){ throw new illegalargumentexception("rectangle is null"); } boolean flag = false; try{ set<rectangle> rectangleset = this.getcollisioncandidates(rectangle); for(rectangle re:rectangleset){ if(re.intersects(rectangle)){ flag = true; } } }catch (exception e){ system.out.println(e.getmessage()); }finally { return flag; } }