### Question:
KernelTransactionImplementation implements KernelTransaction, TxStateHolder, ExecutionStatistics { @Override public Map<String, Object> getMetaData() { return userMetaData; } KernelTransactionImplementation( Config config, StatementOperationParts statementOperations, SchemaWriteGuard schemaWriteGuard,
            TransactionHooks hooks, ConstraintIndexCreator constraintIndexCreator, Procedures procedures,
            TransactionHeaderInformationFactory headerInformationFactory, TransactionCommitProcess commitProcess, TransactionMonitor transactionMonitor,
            AuxiliaryTransactionStateManager auxTxStateManager, Pool<KernelTransactionImplementation> pool, SystemNanoClock clock,
            AtomicReference<CpuClock> cpuClockRef, AtomicReference<HeapAllocation> heapAllocationRef, TransactionTracer transactionTracer,
            LockTracer lockTracer, PageCursorTracerSupplier cursorTracerSupplier, StorageEngine storageEngine, AccessCapability accessCapability,
            AutoIndexing autoIndexing, ExplicitIndexStore explicitIndexStore, VersionContextSupplier versionContextSupplier,
            CollectionsFactorySupplier collectionsFactorySupplier, ConstraintSemantics constraintSemantics, SchemaState schemaState,
            IndexingService indexingService, TokenHolders tokenHolders, Dependencies dataSourceDependencies ); KernelTransactionImplementation initialize( long lastCommittedTx, long lastTimeStamp, StatementLocks statementLocks, Type type,
            SecurityContext frozenSecurityContext, long transactionTimeout, long userTransactionId ); @Override long startTime(); @Override long startTimeNanos(); @Override long timeout(); @Override long lastTransactionIdWhenStarted(); @Override void success(); @Override void failure(); @Override Optional<Status> getReasonIfTerminated(); @Override void markForTermination( Status reason ); @Override boolean isSchemaTransaction(); @Override boolean isOpen(); @Override SecurityContext securityContext(); @Override AuthSubject subjectOrAnonymous(); @Override void setMetaData( Map<String, Object> data ); @Override Map<String, Object> getMetaData(); @Override KernelStatement acquireStatement(); @Override IndexDescriptor indexUniqueCreate( SchemaDescriptor schema, String provider ); @Override long pageHits(); @Override long pageFaults(); @Override TransactionState txState(); @Override AuxiliaryTransactionState auxiliaryTxState( Object providerIdentityKey ); @Override ExplicitIndexTransactionState explicitIndexTxState(); @Override boolean hasTxStateWithChanges(); @Override void assertOpen(); @Override long closeTransaction(); boolean isClosing(); @Override Read dataRead(); @Override Write dataWrite(); @Override TokenWrite tokenWrite(); @Override Token token(); @Override TokenRead tokenRead(); @Override ExplicitIndexRead indexRead(); @Override ExplicitIndexWrite indexWrite(); @Override SchemaRead schemaRead(); @Override SchemaWrite schemaWrite(); @Override org.neo4j.internal.kernel.api.Locks locks(); StatementLocks statementLocks(); @Override CursorFactory cursors(); @Override org.neo4j.internal.kernel.api.Procedures procedures(); @Override ExecutionStatistics executionStatistics(); LockTracer lockTracer(); void assertAllows( Function<AccessMode,Boolean> allows, String mode ); @Override boolean isTerminated(); @Override long lastTransactionTimestampWhenStarted(); @Override void registerCloseListener( CloseListener listener ); @Override Type transactionType(); @Override long getTransactionId(); @Override long getCommitTime(); @Override Revertable overrideWith( SecurityContext context ); @Override String toString(); void dispose(); Stream<? extends ActiveLock> activeLocks(); Statistics getStatistics(); long getTransactionDataRevision(); @Override ClockContext clocks(); @Override NodeCursor ambientNodeCursor(); @Override RelationshipScanCursor ambientRelationshipCursor(); @Override PropertyCursor ambientPropertyCursor();  }### Answer:
@Test public void emptyMetadataReturnedWhenMetadataIsNotSet() throws TransactionFailureException { try ( KernelTransaction transaction = newTransaction( loginContext() ) ) { Map<String,Object> metaData = transaction.getMetaData(); assertTrue( metaData.isEmpty() ); } }