//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private boolean serialize(org.neo4j.kernel.impl.transaction.log.InMemoryClosableChannel channel, IndexDefineCommand command) throws java.io.IOException
        private bool Serialize(InMemoryClosableChannel channel, IndexDefineCommand command)
        {
            try
            {
                command.Serialize(channel);
            }
            catch (AssertionError)
            {
                return(true);
            }
            return(false);
        }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldWriteIndexDefineCommandIfMapWithinShortRange() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldWriteIndexDefineCommandIfMapWithinShortRange()
        {
            // GIVEN
            InMemoryClosableChannel channel = new InMemoryClosableChannel(10_000);
            IndexDefineCommand      command = InitIndexDefineCommand(300);

            // WHEN
            command.Serialize(channel);

            // THEN
            CommandReader      commandReader = (new RecordStorageCommandReaderFactory()).byVersion(LogEntryVersion.CURRENT.byteCode());
            IndexDefineCommand read          = ( IndexDefineCommand )commandReader.Read(channel);

            assertEquals(command.IndexNameIdRange, read.IndexNameIdRange);
            assertEquals(command.KeyIdRange, read.KeyIdRange);
        }