StateDescriptionFragmentImpl implements StateDescriptionFragment { @SuppressWarnings("deprecation") @Override public @Nullable StateDescription toStateDescription() { if (minimum == null && maximum == null && step == null && readOnly == null && pattern == null && options == null) { return null; } final Boolean ro = readOnly; return new StateDescription(minimum, maximum, step, pattern, ro == null ? false : ro.booleanValue(), options); } StateDescriptionFragmentImpl(); @Deprecated  StateDescriptionFragmentImpl(@Nullable BigDecimal minimum, @Nullable BigDecimal maximum,
            @Nullable BigDecimal step, @Nullable String pattern, @Nullable Boolean readOnly,
            @Nullable List<StateOption> options); @Deprecated  StateDescriptionFragmentImpl(StateDescription legacy);  StateDescriptionFragmentImpl(StateDescriptionFragmentImpl source); @Override @Nullable BigDecimal getMinimum(); void setMinimum(BigDecimal minimum); @Override @Nullable BigDecimal getMaximum(); void setMaximum(BigDecimal maximum); @Override @Nullable BigDecimal getStep(); void setStep(BigDecimal step); @Override @Nullable String getPattern(); void setPattern(String pattern); @Override @Nullable Boolean isReadOnly(); void setReadOnly(Boolean readOnly); @Override @Nullable List<StateOption> getOptions(); void setOptions(List<StateOption> options); @SuppressWarnings("deprecation") @Override @Nullable StateDescription toStateDescription(); StateDescriptionFragment merge(StateDescriptionFragment fragment); @Override int hashCode(); @Override boolean equals(@Nullable Object obj); @Override String toString();  }
@Test @SuppressWarnings("null") public void toStateDescription() { StateDescription stateDescription = source.toStateDescription(); assertThat(stateDescription.getMinimum(), is(source.getMinimum())); assertThat(stateDescription.getMaximum(), is(source.getMaximum())); assertThat(stateDescription.getStep(), is(source.getStep())); assertThat(stateDescription.getPattern(), is(source.getPattern())); assertThat(stateDescription.isReadOnly(), is(source.isReadOnly())); assertThat(stateDescription.getOptions(), is(source.getOptions())); }