DefaultMetadataHeaders extends AbstractSet<MetadataHeader> implements MetadataHeaders { static DefaultMetadataHeaders parseMetadataHeaders(final CharSequence metadataHeadersCharSequence) { checkNotNull(metadataHeadersCharSequence, "metadataHeadersCharSequence"); final DefaultMetadataHeaders result; if (0 < metadataHeadersCharSequence.length()) { result = parseJsonArray(JsonArray.of(metadataHeadersCharSequence.toString())); } else { result = newInstance(); } return result; } private  DefaultMetadataHeaders(final SortedSet<MetadataHeader> treeSet); @Override JsonArray toJson(); @Override boolean add(final MetadataHeader metadataHeader); @Override boolean addAll(final Collection<? extends MetadataHeader> c); @Override Iterator<MetadataHeader> iterator(); @Override boolean remove(final Object o); @Override boolean removeAll(final Collection<?> c); @Override boolean retainAll(final Collection<?> c); @Override void clear(); @Override int size(); @Override Comparator<? super MetadataHeader> comparator(); @Override SortedSet<MetadataHeader> subSet(final MetadataHeader metadataHeader, final MetadataHeader e1); @Override SortedSet<MetadataHeader> headSet(final MetadataHeader metadataHeader); @Override SortedSet<MetadataHeader> tailSet(final MetadataHeader metadataHeader); @Override MetadataHeader first(); @Override MetadataHeader last(); @Override boolean equals(@Nullable final Object o); @Override int hashCode();  }
@Test public void parseNullMetadataHeaderValue() { assertThatNullPointerException() .isThrownBy(() -> DefaultMetadataHeaders.parseMetadataHeaders(null)) .withMessage("The metadataHeadersCharSequence must not be null!") .withNoCause(); }
@Test public void parseEmptyCharSequence() { assertThat(DefaultMetadataHeaders.parseMetadataHeaders("")).isEmpty(); }
@Test public void parseEmptyJsonArrayCharSequence() { final String metadataHeaderValue = String.valueOf(JsonArray.empty()); assertThat(DefaultMetadataHeaders.parseMetadataHeaders(metadataHeaderValue)).isEmpty(); }
@Test public void parseNonJsonArrayCharSequence() { assertThatExceptionOfType(JsonParseException.class) .isThrownBy(() -> DefaultMetadataHeaders.parseMetadataHeaders("42")) .withMessage("<42> is not a valid JSON array!") .withNoCause(); }