### Question:
StreamId { public static long next(final long prev, final boolean client, final boolean bidirectional) { long v = encodeType(client, bidirectional, prev); long tmp = v; while (v <= prev) { tmp++; v = encodeType(client, bidirectional, tmp); } return v; } private  StreamId(); static long random(final boolean client, final boolean bidirectional); static long next(final long prev, final boolean client, final boolean bidirectional); static long parse(final ByteBuf bb); static long validate(final long id); static boolean isClient(final long id); static boolean isBidirectional(final long id); static void write(final ByteBuf bb, final long id);  }### Answer:
@Test public void next() { assertEquals(3, StreamId.next(0, false, false)); assertEquals(1, StreamId.next(0, false, true)); assertEquals(4, StreamId.next(0, true, true)); }