@Test(expected = IllegalArgumentException.class) public void at_xTooLow() { Pad pad = Pad.at(Pad.X_MIN - 1, Pad.Y_MIN); }
public static Pad at(int x, int y) { if (x < X_MIN || x > X_MAX || y < Y_MIN || y > Y_MAX) { throw new IllegalArgumentException("Illegal pad coordinates : (" + x + "," + y + "). Acceptable values are in [0..7] on both axis."); } return PADS[x][y]; }
Pad { public static Pad at(int x, int y) { if (x < X_MIN || x > X_MAX || y < Y_MIN || y > Y_MAX) { throw new IllegalArgumentException("Illegal pad coordinates : (" + x + "," + y + "). Acceptable values are in [0..7] on both axis."); } return PADS[x][y]; } }
Pad { public static Pad at(int x, int y) { if (x < X_MIN || x > X_MAX || y < Y_MIN || y > Y_MAX) { throw new IllegalArgumentException("Illegal pad coordinates : (" + x + "," + y + "). Acceptable values are in [0..7] on both axis."); } return PADS[x][y]; } private  Pad(int x, int y); }
Pad { public static Pad at(int x, int y) { if (x < X_MIN || x > X_MAX || y < Y_MIN || y > Y_MAX) { throw new IllegalArgumentException("Illegal pad coordinates : (" + x + "," + y + "). Acceptable values are in [0..7] on both axis."); } return PADS[x][y]; } private  Pad(int x, int y); static Pad at(int x, int y); int getX(); int getY(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Pad { public static Pad at(int x, int y) { if (x < X_MIN || x > X_MAX || y < Y_MIN || y > Y_MAX) { throw new IllegalArgumentException("Illegal pad coordinates : (" + x + "," + y + "). Acceptable values are in [0..7] on both axis."); } return PADS[x][y]; } private  Pad(int x, int y); static Pad at(int x, int y); int getX(); int getY(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final int X_MIN; static final int X_MAX; static final int Y_MIN; static final int Y_MAX; }