### Question:
ObservationUi implements Serializable { public static ObservationUi from(Ui.ObservationUI sc2ApiObservationUi) { require("sc2api observation ui", sc2ApiObservationUi); return new ObservationUi(sc2ApiObservationUi); } private  ObservationUi(Ui.ObservationUI sc2ApiObservationUi); static ObservationUi from(Ui.ObservationUI sc2ApiObservationUi); Set<ControlGroup> getControlGroups(); Optional<SinglePanel> getSinglePanel(); Optional<MultiPanel> getMultiPanel(); Optional<CargoPanel> getCargoPanel(); Optional<ProductionPanel> getProductionPanel(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiObservationUiIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> ObservationUi.from(nothing())) .withMessage("sc2api observation ui is required"); }
@Test void convertsAllFieldsFromSc2ApiObservationUi() { assertThatAllFieldsAreConvertedForSinglePanel(ObservationUi.from(sc2ApiObservationUiSingle())); assertThatAllFieldsAreConvertedForMultiPanel(ObservationUi.from(sc2ApiObservationUiMulti())); assertThatAllFieldsAreConvertedForCargoPanel(ObservationUi.from(sc2ApiObservationUiCargo())); assertThatAllFieldsAreConvertedForProductionPanel(ObservationUi.from(sc2ApiObservationUiProduction())); }
@Test void fulfillsEqualsContract() { EqualsVerifier .forClass(ObservationUi.class) .withNonnullFields("controlGroups") .withPrefabValues(UnitInfo.class, UnitInfo.from(sc2ApiUnitInfoAddOn()), UnitInfo.from(sc2ApiUnitInfo())) .verify(); }