@Test
  public void testIsOpenOutOfRange() {
    Percolation p = new Percolation(10);

    try {
      p.isOpen(10 + 1, 5);
      fail("Line above should throw exception");
    } catch (IndexOutOfBoundsException e) {
      /* Expected */
    }

    try {
      p.isOpen(5, 10 + 1);
      fail("Line above should throw exception");
    } catch (IndexOutOfBoundsException e) {
      /* Expected */
    }

    try {
      p.isOpen(0, 5);
      fail("Line above should throw exception");
    } catch (IndexOutOfBoundsException e) {
      /* Expected */
    }

    try {
      p.isOpen(-5, 5);
      fail("Line above should throw exception");
    } catch (IndexOutOfBoundsException e) {
      /* Expected */
    }

    try {
      p.isOpen(5, 0);
      fail("Line above should throw exception");
    } catch (IndexOutOfBoundsException e) {
      /* Expected */
    }

    try {
      p.isOpen(5, -5);
      fail("Line above should throw exception");
    } catch (IndexOutOfBoundsException e) {
      /* Expected */
    }
  }