Authorisations implements Iterable<byte[]>, Serializable { public String serialise() { StringBuilder sb = new StringBuilder(HEADER); String sep = ""; for (final byte[] auth : authsList) { sb.append(sep); sep = ","; sb.append(Base64.getEncoder().encodeToString(auth)); } return sb.toString(); } Authorisations();  Authorisations(final String... authorisations);  Authorisations(final byte[] authorisations); List<byte[]> getAuthorisations(); byte[] getAuthorisationsArray(); List<ByteBuffer> getAuthorisationsBB(); String serialise(); String toString(); boolean contains(final byte[] auth); boolean contains(final ArrayByteSequence auth); boolean contains(final String auth); boolean equals(final Object o); int hashCode(); int size(); boolean isEmpty(); Iterator<byte[]> iterator(); static final String HEADER; }
@Test public void testSerialization() { final Authorisations a1 = new Authorisations("a", "b"); final Authorisations a2 = new Authorisations("b", "a"); assertEquals(a1, a2); assertEquals(a1.serialise(), a2.serialise()); }