### Question:
MapState implements Serializable { public static MapState from(Raw.MapState sc2ApiMapState) { require("sc2api map state", sc2ApiMapState); return new MapState(sc2ApiMapState); } private  MapState(Raw.MapState sc2ApiMapState); static MapState from(Raw.MapState sc2ApiMapState); ImageData getVisibility(); ImageData getCreep(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiMapStateIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> MapState.from(nothing())) .withMessage("sc2api map state is required"); }
@Test void convertsAllFieldsFromSc2ApiMapState() { assertThatAllFieldsAreConverted(MapState.from(sc2ApiMapState())); }
@Test void throwsExceptionWhenVisibilityIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> MapState.from(without( () -> sc2ApiMapState().toBuilder(), Raw.MapState.Builder::clearVisibility).build())) .withMessage("visibility is required"); }
@Test void throwsExceptionWhenCreepIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> MapState.from(without( () -> sc2ApiMapState().toBuilder(), Raw.MapState.Builder::clearCreep).build())) .withMessage("creep is required"); }