Authorisations implements Iterable<byte[]>, Serializable { public byte[] getAuthorisationsArray() { return serialise().getBytes(UTF_8); } 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 testEncodeDecode() { final Authorisations a = new Authorisations("a", "abcdefg", "hijklmno", ","); final byte[] array = a.getAuthorisationsArray(); final Authorisations b = new Authorisations(array); assertEquals(a, b); }
@Test public void testEncodeEmptyAuthorisations() { final Authorisations a = new Authorisations(); final byte[] array = a.getAuthorisationsArray(); final Authorisations b = new Authorisations(array); assertEquals(a, b); }
@Test public void testEncodeMultiByteAuthorisations() { final Authorisations a = new Authorisations("五", "b", "c", "九"); final byte[] array = a.getAuthorisationsArray(); final Authorisations b = new Authorisations(array); assertEquals(a, b); }