### Question:
Size2dI implements Sc2ApiSerializable<Common.Size2DI> { public static Size2dI from(Common.Size2DI sc2ApiSize2dI) { require("sc2api size2dI", sc2ApiSize2dI); return new Size2dI(sc2ApiSize2dI); } private  Size2dI(Common.Size2DI sc2ApiSize2dI); private  Size2dI(int x, int y); static Size2dI from(Common.Size2DI sc2ApiSize2dI); @Override Common.Size2DI toSc2Api(); int getX(); int getY(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static Size2dI of(int x, int y);  }### Answer:
@Test void throwsExceptionWhenSc2ApiSize2dIIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> Size2dI.from(nothing())) .withMessage("sc2api size2dI is required"); }
@Test void convertsAllFieldsFromSc2ApiSize2dI() { assertThatAllFieldsAreConverted(Size2dI.from(sc2ApiSize2dI())); }
@Test void throwsExceptionWhenXIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> Size2dI.from(without( () -> sc2ApiSize2dI().toBuilder(), Common.Size2DI.Builder::clearX).build())) .withMessage("x is required"); }
@Test void throwsExceptionWhenYIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> Size2dI.from(without( () -> sc2ApiSize2dI().toBuilder(), Common.Size2DI.Builder::clearY).build())) .withMessage("y is required"); }