class DefaultLookup implements Lookup {

    private final PlexusContainer container;

    @Inject
    public DefaultLookup(PlexusContainer container) {
        this.container = container;
    }

    @Override
    public <T> T lookup(Class<T> type) {
        try {
            return container.lookup(type);
        } catch (ComponentLookupException e) {
            throw new LookupException(e);
        }
    }

    @Override
    public <T> T lookup(Class<T> type, String name) {
        try {
            return container.lookup(type, name);
        } catch (ComponentLookupException e) {
            throw new LookupException(e);
        }
    }

    @Override
    public <T> Optional<T> lookupOptional(Class<T> type) {
        try {
            return Optional.of(container.lookup(type));
        } catch (ComponentLookupException e) {
            if (e.getCause() instanceof NoSuchElementException) {
                return Optional.empty();
            }
            throw new LookupException(e);
        }
    }

    @Override
    public <T> Optional<T> lookupOptional(Class<T> type, String name) {<FILL_FUNCTION_BODY>}

    @Override
    public <T> List<T> lookupList(Class<T> type) {
        try {
            return container.lookupList(type);
        } catch (ComponentLookupException e) {
            throw new LookupException(e);
        }
    }

    @Override
    public <T> Map<String, T> lookupMap(Class<T> type) {
        try {
            return container.lookupMap(type);
        } catch (ComponentLookupException e) {
            throw new LookupException(e);
        }
    }
}

        try {
            return Optional.of(container.lookup(type, name));
        } catch (ComponentLookupException e) {
            if (e.getCause() instanceof NoSuchElementException) {
                return Optional.empty();
            }
            throw new LookupException(e);
        }
    
<no_super_class>