private static void drawOcean(Graphics graphics, Ocean ocean) {
    if (ocean != null) {
      int width = ocean.width();
      int height = ocean.height();

      for (int y = 0; y < height; y++) {
        for (int x = 0; x < width; x++) {
          int contents = ocean.cellContents(x, y);
          if (contents == Ocean.SHARK) {
            graphics.setColor(Color.red);                   // Draw a red shark
            graphics.fillRect(x * cellSize, y * cellSize, cellSize, cellSize);
          } else if (contents == Ocean.FISH) {
            graphics.setColor(Color.green);                // Draw a green fish
            graphics.fillRect(x * cellSize, y * cellSize, cellSize, cellSize);
          } else {
            graphics.clearRect(x * cellSize, y * cellSize, cellSize, cellSize);
          }
        }
      }
    }
  }