Dimensions { public Dimensions scaleToHeight(final int newHeight) { return new Dimensions(newHeight, width * newHeight / height); } Dimensions(final int height, final int width);  Dimensions(final int squareSize); int getHeight(); int getWidth(); Dimensions multiply(final int factor); Dimensions divide(final int divisor); Dimensions scaleToWidth(final int newWidth); Dimensions scaleToHeight(final int newHeight); @Override int hashCode(); @Override boolean equals(final Object obj); @Override String toString(); static Dimensions fromString(final String string);  }
@Test public void scaleToHeigth() { assertThat(new Dimensions(2, 4).scaleToHeight(10)).isEqualTo(new Dimensions(10, 20)); }