### Question:
PowerSource implements Serializable { public static PowerSource from(Raw.PowerSource sc2ApiPowerSource) { require("sc2api power source", sc2ApiPowerSource); return new PowerSource(sc2ApiPowerSource); } private  PowerSource(Raw.PowerSource sc2ApiPowerSource); static PowerSource from(Raw.PowerSource sc2ApiPowerSource); Point getPosition(); float getRadius(); Tag getTag(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiPowerSourceIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> PowerSource.from(nothing())) .withMessage("sc2api power source is required"); }
@Test void convertsAllFieldsFromSc2ApiPowerSource() { assertThatAllFieldsAreConverted(PowerSource.from(sc2ApiPowerSource())); }
@Test void throwsExceptionWhenPositionIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> PowerSource.from(without( () -> sc2ApiPowerSource().toBuilder(), Raw.PowerSource.Builder::clearPos).build())) .withMessage("position is required"); }
@Test void throwsExceptionWhenRadiusIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> PowerSource.from(without( () -> sc2ApiPowerSource().toBuilder(), Raw.PowerSource.Builder::clearRadius).build())) .withMessage("radius is required"); }
@Test void throwsExceptionWhenTagIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> PowerSource.from(without( () -> sc2ApiPowerSource().toBuilder(), Raw.PowerSource.Builder::clearTag).build())) .withMessage("tag is required"); }