DittoAcknowledgementLabel implements AcknowledgementLabel { public static boolean contains(@Nullable final AcknowledgementLabel acknowledgementLabel) { if (null != acknowledgementLabel) { for (final AcknowledgementLabel dittoAcknowledgementLabel : values()) { if (dittoAcknowledgementLabel.equals(acknowledgementLabel)) { return true; } } } return false; } private  DittoAcknowledgementLabel(final CharSequence labelValue); static AcknowledgementLabel[] values(); static boolean contains(@Nullable final AcknowledgementLabel acknowledgementLabel); @SuppressWarnings("squid:S2097") @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override int length(); @Override char charAt(final int index); @Override CharSequence subSequence(final int start, final int end); @Override String toString(); static final DittoAcknowledgementLabel TWIN_PERSISTED; static final DittoAcknowledgementLabel LIVE_RESPONSE; }
@Test public void containsNullIsFalse() { assertThat(DittoAcknowledgementLabel.contains(null)).isFalse(); }
@Test public void doesNotContainGivenLabel() { final AcknowledgementLabel acknowledgementLabel = AcknowledgementLabel.of("abc"); assertThat(DittoAcknowledgementLabel.contains(acknowledgementLabel)).isFalse(); }
@Test public void containsConstantOfSelf() { assertThat(DittoAcknowledgementLabel.contains(DittoAcknowledgementLabel.TWIN_PERSISTED)).isTrue(); }