MimePath { @Override public final String toString() { List<Integer> parts = Arrays.stream(positions) .boxed() .collect(Guavate.toImmutableList()); return "MIMEPath:" + Joiner.on('.') .join(parts); } MimePath(int[] positions); int[] getPositions(); @Override final boolean equals(Object o); @Override final int hashCode(); @Override final String toString();  }
@Test void toStringWhenEmpty() { int[] empty = {}; assertThat(new MimePath(empty).toString()) .isEqualTo("MIMEPath:"); }
@Test void toStringWhenSingle() { int[] single = {1}; assertThat(new MimePath(single).toString()) .isEqualTo("MIMEPath:1"); }
@Test void toStringWhenMany() { int[] many = {1, 2, 3}; assertThat(new MimePath(many).toString()) .isEqualTo("MIMEPath:1.2.3"); }