private boolean compare(Cordinate startPoint, Cordinate point1, Cordinate point2,int len, int diag){
        if(2*len != diag){
            return false;
        }
        int a1 = distanceSquare(startPoint,point1);
        int a2 = distanceSquare(startPoint,point2);
        if(a1 != len || a2 != len){
            return false;
        }
        return true;
    }
Given four points in any order determine if they form a square
Test cases
Less than or more than 4 points in input
Points could be in any quadrants e.it neg and pos allowed
src/com/interview/misc/FourPointsFormSquare.java