### Question:
FreelistNode { void write( PageCursor cursor, long unstableGeneration, long pageId, int pos ) { if ( pageId == NO_PAGE_ID ) { throw new IllegalArgumentException( "Tried to write pageId " + pageId + " which means null" ); } assertPos( pos ); GenerationSafePointer.assertGenerationOnWrite( unstableGeneration ); cursor.setOffset( entryOffset( pos ) ); cursor.putInt( (int) unstableGeneration ); put6BLong( cursor, pageId ); } FreelistNode( int pageSize );   }### Answer:
@Test void shouldFailOnWritingBeyondMaxEntries() { assertThrows( IllegalArgumentException.class, () -> freelist.write( cursor, 1, 10, maxEntries ) ); }
@Test void shouldFailOnWritingTooBigPointer() { assertThrows( IllegalArgumentException.class, () -> freelist.write( cursor, 1, PageCursorUtil._6B_MASK + 1, 0 ) ); }
@Test void shouldFailOnWritingTooBigGeneration() { assertThrows( IllegalArgumentException.class, () -> freelist.write( cursor, GenerationSafePointer.MAX_GENERATION + 1, 1, 0 ) ); }