private static void assertValid(int y, int m, int d) {
        if (y < MIN_Y || y > MAX_Y) {
            throw new  IllegalArgumentException();
        }
        if (m < MIN_M || m > MAX_M) {
            throw new  IllegalArgumentException();
        }
        if (d < MIN_D || d > MAX_D) {
            throw new  IllegalArgumentException();
        }
    }