### Question:
MimeHeaders { public Iterable<String> trailerValues(final String name) { return new Iterable<String>() { @Override public Iterator<String> iterator() { return new ValuesIterator(MimeHeaders.this, name, true); } }; } MimeHeaders(); void mark(); void recycle(); void clear(); @Override String toString(); void copyFrom(final MimeHeaders source); int size(); int trailerSize(); DataChunk getName(int n); DataChunk getValue(int n); boolean isSerialized(int n); boolean setSerialized(int n, boolean newValue); int indexOf(String name, int fromIndex); int indexOf(final Header header, final int fromIndex); boolean contains(final Header header); boolean contains(final String header); Iterable<String> names(); Iterable<String> trailerNames(); Iterable<String> values(final String name); Iterable<String> values(final Header name); Iterable<String> trailerValues(final String name); @SuppressWarnings("unused") Iterable<String> trailerValues(final Header name); DataChunk addValue(String name); DataChunk addValue(final Header header); DataChunk addValue(final byte[] buffer, final int startN, final int len); DataChunk addValue(final Buffer buffer, final int startN, final int len); DataChunk setValue(final String name); DataChunk setValue(final Header header); DataChunk getValue(String name); DataChunk getValue(final Header header); String getHeader(String name); String getHeader(final Header header); void removeHeader(String name); void removeHeader(final Header header); @SuppressWarnings("UnusedDeclaration") void removeHeader(final String name, final String str); @SuppressWarnings("UnusedDeclaration") void removeHeaderMatches(final String name, final String regex); void removeHeaderMatches(final Header header, final String regex); void setMaxNumHeaders(int maxNumHeaders); @SuppressWarnings("unused") int getMaxNumHeaders(); static final int MAX_NUM_HEADERS_UNBOUNDED; static final int MAX_NUM_HEADERS_DEFAULT; static final int DEFAULT_HEADER_SIZE; static DataChunk NOOP_CHUNK; }### Answer:
@Test public void testTrailerValues() throws Exception { final String[] expectedValuesSet1 = { "one", "two", "three" }; final String[] expectedValuesSet2 = { "one" }; final String[] emptySet = {}; Iterable<String> result = mimeHeaders.trailerValues("custom-before"); List<String> list = new ArrayList<>(); for (String s : result) { list.add(s); } Assert.assertArrayEquals(emptySet, list.toArray(new String[list.size()])); result = mimeHeaders.trailerValues("custom-before-2"); list = new ArrayList<>(); for (String s : result) { list.add(s); } Assert.assertArrayEquals(emptySet, list.toArray(new String[list.size()])); result = mimeHeaders.trailerValues("custom-after"); list = new ArrayList<>(); for (String s : result) { list.add(s); } Assert.assertArrayEquals(expectedValuesSet1, list.toArray(new String[list.size()])); result = mimeHeaders.trailerValues("custom-after-2"); list = new ArrayList<>(); for (String s : result) { list.add(s); } Assert.assertArrayEquals(expectedValuesSet2, list.toArray(new String[list.size()])); }