title: I need class that will create rectangle using coordinates of the centers, high (X axis) and width (y axis)
body: <p>Rectangle is formed using on this test</p>
  <pre><code> @Test
      public void testRectangle1() {
      Point center = new Point(20, 30);
      Rectangle rect = new Rectangle(center, 20, 20);
      assertAll(
      () -&gt; assertEquals(10, rect.getTopLeft().getX()),
      () -&gt; assertEquals(20, rect.getTopLeft().getY()),
      () -&gt; assertEquals(30, rect.getBottomRight().getX()),
      () -&gt; assertEquals(40, rect.getBottomRight().getY()),
      () -&gt; assertEquals(20, rect.getWidth()),
      () -&gt; assertEquals(20, rect.getHeight())
          );
      }
  </code></pre>
  <p>I already have class for point it should work correctly i mostly add it for understanding.</p>
  <pre><code>public class Point {
      private int x, y;
      public Point(int x, int y) {
          this.x = x;
          this.y = y;
      }
      public Point() {
          this(0, 0);
      }
      public int getX() {
          return x;
      }
      public void setX(int x) {
          this.x = x;
      }
      public int getY() {
          return y;
      }
      public void setY(int y) {
          this.y = y;
      }
      public void moveTo(int newX, int newY) {
          x = newX;
          y = newY;
      }
      public void moveRel(int dx, int dy) {
          x += dx;
          y += dy;
      }
      @Override
      public int hashCode() {
          final int prime = 31;
          int result = 1;
          result = prime * result + x;
          result = prime * result + y;
          return result;
      }
      @Override
      public boolean equals(Object obj) {
          if (this == obj)
              return true;
          if (obj == null)
              return false;
          if (getClass() != obj.getClass())
              return false;
          Point other = (Point) obj;
          if (x != other.x)
              return false;
          if (y != other.y)
              return false;
          return true;
      }
  }
  </code></pre>
  <p>So  i stuck in second class for rectangle itself. First of all i kinda have hard time forming consructor that will form rectangle itself. And also on filling methods in rectangle class, as i have hard time in uderstanding what they should return becouse i have little experience in Java and coding.</p>
  <pre><code>public class Rectangle {
      public int width = 0;
      public int height = 0;
      public Point center;
  
      public Rectangle(Point center, int width, int height) {
          int x = 0;
          int y = 0;
          width=x;
          height=y;
      }
  
      public Point getTopLeft() {
          Point point = new Point();
          return point;
      }
  
      public Point getBottomRight() {
          Point point = new Point();
          return point;
      }
  
      public int getWidth() {
          int x = 0;
          return x;
      }
  
  
      public int getHeight() {
          int y = 0;
          return y;
      }
  }
  </code></pre>