### Question:
SinglePanel implements Serializable { public static SinglePanel from(Ui.SinglePanel sc2ApiSinglePanel) { require("sc2api single panel", sc2ApiSinglePanel); return new SinglePanel(sc2ApiSinglePanel); } private  SinglePanel(Ui.SinglePanel sc2ApiSinglePanel); static SinglePanel from(Ui.SinglePanel sc2ApiSinglePanel); UnitInfo getUnit(); Optional<Integer> getAttackUpgradeLevel(); Optional<Integer> getArmorUpgradeLevel(); Optional<Integer> getShieldUpgradeLevel(); Set<Buff> getBuffs(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }### Answer:
@Test void throwsExceptionWhenSc2ApiSinglePanelIsNull() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> SinglePanel.from(nothing())) .withMessage("sc2api single panel is required"); }
@Test void convertsAllFieldsFromSc2ApiSinglePanel() { assertThatAllFieldsAreConverted(SinglePanel.from(sc2ApiSinglePanel())); }
@Test void throwsExceptionWhenTagIsNotProvided() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> SinglePanel.from( without(() -> sc2ApiSinglePanel().toBuilder(), Ui.SinglePanel.Builder::clearUnit).build())) .withMessage("unit is required"); }
@Test void fulfillsEqualsContract() { EqualsVerifier .forClass(SinglePanel.class) .withNonnullFields("unit", "buffs") .withPrefabValues(UnitInfo.class, UnitInfo.from(sc2ApiUnitInfoAddOn()), UnitInfo.from(sc2ApiUnitInfo())) .verify(); }