### Question:
AbstractTabOverlayHandler implements PacketHandler, TabOverlayHandler { @Override public <R> R enterContentOperationMode(ContentOperationMode<R> operationMode) { AbstractContentOperationModeHandler<?> handler; if (operationMode == ContentOperationMode.PASS_TROUGH) { handler = new PassThroughContentHandler(); } else if (operationMode == ContentOperationMode.SIMPLE) { handler = new SimpleOperationModeHandler(); } else if (operationMode == ContentOperationMode.RECTANGULAR) { handler = new RectangularSizeHandler(); } else { throw new UnsupportedOperationException(); } nextActiveContentHandlerQueue.add(handler); scheduleUpdate(); return (R) handler.getTabOverlay(); } AbstractTabOverlayHandler(Logger logger, Executor eventLoopExecutor, UUID viewerUuid, boolean is18, boolean is13OrLater); @Override PacketListenerResult onPlayerListPacket(PlayerListItem packet); @Override PacketListenerResult onTeamPacket(Team packet); @Override PacketListenerResult onPlayerListHeaderFooterPacket(PlayerListHeaderFooter packet); @Override void onServerSwitch(boolean is13OrLater); @Override R enterContentOperationMode(ContentOperationMode<R> operationMode); @Override R enterHeaderAndFooterOperationMode(HeaderAndFooterOperationMode<R> operationMode);  }### Answer:
@Test public void testPassThrough() { assertEquals(0, clientTabList.getSize()); SimpleTabOverlay tabOverlay = tabOverlayHandler.enterContentOperationMode(ContentOperationMode.SIMPLE); assertEquals(0, clientTabList.getSize()); assertEquals(80, tabOverlay.getMaxSize()); tabOverlay.setSize(1); assertEquals(1, clientTabList.getSize()); tabOverlayHandler.enterContentOperationMode(ContentOperationMode.PASS_TROUGH); assertFalse(tabOverlay.isValid()); assertEquals(0, clientTabList.getSize()); tabOverlay = tabOverlayHandler.enterContentOperationMode(ContentOperationMode.SIMPLE); tabOverlay.setSize(2); assertEquals(2, clientTabList.getSize()); tabOverlay.setSlot(1, Icon.DEFAULT_ALEX, "Slot", 1); assertEquals(2, clientTabList.getSize()); assertArrayEquals("Skin check failed", new String[0][], clientTabList.getProperties(1)); assertEquals("Text check failed", "Slot", clientTabList.getText(1)); assertEquals("Ping check failed", 1, clientTabList.getPing(1)); }
@Test public void testSimpleTabList() { SimpleTabOverlay tabOverlay = tabOverlayHandler.enterContentOperationMode(ContentOperationMode.SIMPLE); for (int size = 1; size <= 80; size++) { tabOverlay.setSize(size); assertEquals("Size check failed for size " + size, size, clientTabList.getSize()); tabOverlay.setSlot(size - 1, Icon.DEFAULT_STEVE, "Slot " + (size - 1), size - 1); for (int i = 0; i < size; i++) { assertArrayEquals("Skin check failed for size " + size + " slot " + i, codecrafter47.bungeetablistplus.api.bungee.Icon.DEFAULT.getProperties(), clientTabList.getProperties(i)); assertEquals("Text check failed for size " + size + " slot " + i, "Slot " + i, clientTabList.getText(i)); assertEquals("Ping check failed for size " + size + " slot " + i, i, clientTabList.getPing(i)); } } }
@Test public void testRectangularTabList() { RectangularTabOverlay tabOverlay = tabOverlayHandler.enterContentOperationMode(ContentOperationMode.RECTANGULAR); for (val dimension : tabOverlay.getSupportedSizes()) { tabOverlay.setSize(dimension); assertEquals("Size check failed for size " + dimension, dimension.getSize(), clientTabList.getSize()); } }