class IgniteTxMappingsImpl implements IgniteTxMappings {
    /** */
    private final Map<UUID, GridDistributedTxMapping> mappings = new ConcurrentHashMap<>();

    /** {@inheritDoc} */
    @Override public void clear() {
        mappings.clear();
    }

    /** {@inheritDoc} */
    @Override public boolean empty() {
        return mappings.isEmpty();
    }

    /** {@inheritDoc} */
    @Override public GridDistributedTxMapping get(UUID nodeId) {
        return mappings.get(nodeId);
    }

    /** {@inheritDoc} */
    @Override public void put(GridDistributedTxMapping mapping) {
        mappings.put(mapping.primary().id(), mapping);
    }

    /** {@inheritDoc} */
    @Override public GridDistributedTxMapping remove(UUID nodeId) {
        return mappings.remove(nodeId);
    }

    /** {@inheritDoc} */
    @Nullable @Override public GridDistributedTxMapping localMapping() {<FILL_FUNCTION_BODY>}

    /** {@inheritDoc} */
    @Override public boolean single() {
        return false;
    }

    /** {@inheritDoc} */
    @Nullable @Override public GridDistributedTxMapping singleMapping() {
        assert mappings.size() == 1 : mappings;

        return F.firstValue(mappings);
    }

    /** {@inheritDoc} */
    @Override public Collection<GridDistributedTxMapping> mappings() {
        return mappings.values();
    }

    /** {@inheritDoc} */
    @Override public String toString() {
        return S.toString(IgniteTxMappingsImpl.class, this);
    }
}

        for (GridDistributedTxMapping m : mappings.values()) {
            if (m.primary().isLocal())
                return m;
        }

        return null;
    
<no_super_class>