// Path: src/main/java/com/timgroup/karg/reference/Getter.java
// public interface Getter<O, T> {
//     T get(O object);
// }
// 
// Path: src/main/java/com/timgroup/karg/reference/Lens.java
// public interface Lens<O, T> extends Getter<O, T>, Setter<O, T> { }


import java.util.Map;
import java.util.Set;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.timgroup.karg.reference.Getter;
import com.timgroup.karg.reference.Lens;
            .putAll(propertyAccessors)
            .putAll(Maps.filterKeys(fieldAccessors, Predicates.in(fieldOnlyAccessorNames)))
            .build();
        
        return new AccessorCatalogue<O>(mergedAccessors);
    }

    private ImmutableMap<String, Accessor<O, ?>> getters;
    private ImmutableMap<String, Accessor<O, ?>> lenses;
    
    private AccessorCatalogue(Map<String, Accessor<O, ?>> accessors) {
        lenses = ImmutableMap.<String, Accessor<O, ?>>builder().putAll(Maps.filterValues(accessors, isMutable)).build();
        getters = ImmutableMap.<String, Accessor<O, ?>>builder().putAll(accessors).build();
    }

    public ImmutableMap<String, Accessor<O, ?>> readOnlyAttributes() {
        return getters;
    }
    
    public ImmutableMap<String, Accessor<O, ?>> allAttributes() {
        return lenses;
    }

    @SuppressWarnings("unchecked")
    public <T> Lens<O, T> getAttribute(String name) {
        return (Lens<O, T>) lenses.get(name);
    }
    
    @SuppressWarnings("unchecked")
    public <T> Getter<O, T> getReadOnlyAttribute(String name) {
// Path: src/main/java/com/timgroup/karg/reference/Getter.java
// public interface Getter<O, T> {
//     T get(O object);
// }
// 
// Path: src/main/java/com/timgroup/karg/reference/Lens.java
// public interface Lens<O, T> extends Getter<O, T>, Setter<O, T> { }


// Path: src/main/java/com/timgroup/karg/reflection/AccessorCatalogue.java
import java.util.Map;
import java.util.Set;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.timgroup.karg.reference.Getter;
import com.timgroup.karg.reference.Lens;

            .putAll(propertyAccessors)
            .putAll(Maps.filterKeys(fieldAccessors, Predicates.in(fieldOnlyAccessorNames)))
            .build();
        
        return new AccessorCatalogue<O>(mergedAccessors);
    }

    private ImmutableMap<String, Accessor<O, ?>> getters;
    private ImmutableMap<String, Accessor<O, ?>> lenses;
    
    private AccessorCatalogue(Map<String, Accessor<O, ?>> accessors) {
        lenses = ImmutableMap.<String, Accessor<O, ?>>builder().putAll(Maps.filterValues(accessors, isMutable)).build();
        getters = ImmutableMap.<String, Accessor<O, ?>>builder().putAll(accessors).build();
    }

    public ImmutableMap<String, Accessor<O, ?>> readOnlyAttributes() {
        return getters;
    }
    
    public ImmutableMap<String, Accessor<O, ?>> allAttributes() {
        return lenses;
    }

    @SuppressWarnings("unchecked")
    public <T> Lens<O, T> getAttribute(String name) {
        return (Lens<O, T>) lenses.get(name);
    }
    
    @SuppressWarnings("unchecked")
    public <T> Getter<O, T> getReadOnlyAttribute(String name) {
        return (Getter<O, T>) getters.get(name);