// Path: src/main/java/com/timgroup/stanislavski/magic/matchers/MagicJavaBeanMatcher.java
// public final class MagicJavaBeanMatcher<T, I> implements Predicate<MethodCall>, FinalCallHandler<Object> {
//     private final Class<T> targetClass;
// 
//     public static class MagicJavaBeanMatcherBuilder<T> {
//         private Class<T> targetClass;
//         private MagicJavaBeanMatcherBuilder(Class<T> targetClass) {
//             this.targetClass = targetClass;
//         }
//         public <I> I using(Class<I> interfaceClass) {
//             MagicJavaBeanMatcher<T, I> matcher = new MagicJavaBeanMatcher<T, I>(targetClass);
//             return InterceptingMethodCallRecorder.proxying(interfaceClass, matcher, matcher);
//         }
//     }
//     
//     public static <T> MagicJavaBeanMatcher.MagicJavaBeanMatcherBuilder<T> matching(Class<T> targetClass) {
//         return new MagicJavaBeanMatcher.MagicJavaBeanMatcherBuilder<T>(targetClass);
//     }
//     
//     private MagicJavaBeanMatcher(Class<T> targetClass) {
//         this.targetClass = targetClass;
//     }
// 
//     @Override
//     public Object handle(MethodCall closingCall,
//                           Iterable<MethodCall> callHistory) {
//         try {
//             return closingCall.applyTo(makeMatcherFrom(callHistory));
//         } catch (RuntimeException e) {
//             throw e;
//         } catch (Throwable e) {
//             throw new RuntimeException(e);
//         }
//     }
// 
//     @Override
//     public boolean apply(MethodCall methodCall) {
//         return methodCall.targetClass().equals(Matcher.class) || methodCall.targetClass().equals(SelfDescribing.class);
//     }
//     
//     private Matcher<T> makeMatcherFrom(Iterable<MethodCall> callHistory) {
//         return new InstanceWithPropertiesMatcher<T>(targetClass, JavaBeanPropertyMatcherMaker.interpret(targetClass, callHistory));
//     }
// }


import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import org.junit.Test;
import com.google.common.base.Supplier;
import com.timgroup.karg.keywords.typed.TypedKeyword;
import com.timgroup.karg.keywords.typed.TypedKeywordArguments;
import com.timgroup.karg.keywords.typed.TypedKeywords;
import com.timgroup.karg.valuetypes.ValueType;
import com.timgroup.stanislavski.interpreters.AddressesProperty;
import com.timgroup.stanislavski.magic.matchers.MagicJavaBeanMatcher;
            Builder with_age(Integer age);
            Builder with_favourite_colour(String favouriteColour);
            
            @AddressesProperty("quest")
            Builder havingTheNobleQuest(String quest);
            
            @AddressesProperty("quest")
            Builder having_the_noble_quest(String quest);
        }
        
        public static Builder builder() {
            return MagicRecordBuilder.building(TypedKeywordRecord.class).using(Builder.class);
        }
        
        public static Builder updating(TypedKeywordRecord instance) {
            return MagicRecordBuilder.updating(instance).using(Builder.class);
        }
    }
    
    public static interface RecordMatcher extends Matcher<TypedKeywordRecord> {
        RecordMatcher with_name(String name);
        RecordMatcher with_name(Matcher<? super String> name);
        RecordMatcher with_age(Integer age);
        RecordMatcher with_favourite_colour(String favouriteColour);
        
        @AddressesProperty("quest")
        RecordMatcher having_the_noble_quest(String quest);
    }
    
    private RecordMatcher a_record() {
// Path: src/main/java/com/timgroup/stanislavski/magic/matchers/MagicJavaBeanMatcher.java
// public final class MagicJavaBeanMatcher<T, I> implements Predicate<MethodCall>, FinalCallHandler<Object> {
//     private final Class<T> targetClass;
// 
//     public static class MagicJavaBeanMatcherBuilder<T> {
//         private Class<T> targetClass;
//         private MagicJavaBeanMatcherBuilder(Class<T> targetClass) {
//             this.targetClass = targetClass;
//         }
//         public <I> I using(Class<I> interfaceClass) {
//             MagicJavaBeanMatcher<T, I> matcher = new MagicJavaBeanMatcher<T, I>(targetClass);
//             return InterceptingMethodCallRecorder.proxying(interfaceClass, matcher, matcher);
//         }
//     }
//     
//     public static <T> MagicJavaBeanMatcher.MagicJavaBeanMatcherBuilder<T> matching(Class<T> targetClass) {
//         return new MagicJavaBeanMatcher.MagicJavaBeanMatcherBuilder<T>(targetClass);
//     }
//     
//     private MagicJavaBeanMatcher(Class<T> targetClass) {
//         this.targetClass = targetClass;
//     }
// 
//     @Override
//     public Object handle(MethodCall closingCall,
//                           Iterable<MethodCall> callHistory) {
//         try {
//             return closingCall.applyTo(makeMatcherFrom(callHistory));
//         } catch (RuntimeException e) {
//             throw e;
//         } catch (Throwable e) {
//             throw new RuntimeException(e);
//         }
//     }
// 
//     @Override
//     public boolean apply(MethodCall methodCall) {
//         return methodCall.targetClass().equals(Matcher.class) || methodCall.targetClass().equals(SelfDescribing.class);
//     }
//     
//     private Matcher<T> makeMatcherFrom(Iterable<MethodCall> callHistory) {
//         return new InstanceWithPropertiesMatcher<T>(targetClass, JavaBeanPropertyMatcherMaker.interpret(targetClass, callHistory));
//     }
// }


// Path: src/test/java/com/timgroup/stanislavski/magic/builders/MagicTypedKeywordRecordBuilderTest.java
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import org.junit.Test;
import com.google.common.base.Supplier;
import com.timgroup.karg.keywords.typed.TypedKeyword;
import com.timgroup.karg.keywords.typed.TypedKeywordArguments;
import com.timgroup.karg.keywords.typed.TypedKeywords;
import com.timgroup.karg.valuetypes.ValueType;
import com.timgroup.stanislavski.interpreters.AddressesProperty;
import com.timgroup.stanislavski.magic.matchers.MagicJavaBeanMatcher;

            Builder with_age(Integer age);
            Builder with_favourite_colour(String favouriteColour);
            
            @AddressesProperty("quest")
            Builder havingTheNobleQuest(String quest);
            
            @AddressesProperty("quest")
            Builder having_the_noble_quest(String quest);
        }
        
        public static Builder builder() {
            return MagicRecordBuilder.building(TypedKeywordRecord.class).using(Builder.class);
        }
        
        public static Builder updating(TypedKeywordRecord instance) {
            return MagicRecordBuilder.updating(instance).using(Builder.class);
        }
    }
    
    public static interface RecordMatcher extends Matcher<TypedKeywordRecord> {
        RecordMatcher with_name(String name);
        RecordMatcher with_name(Matcher<? super String> name);
        RecordMatcher with_age(Integer age);
        RecordMatcher with_favourite_colour(String favouriteColour);
        
        @AddressesProperty("quest")
        RecordMatcher having_the_noble_quest(String quest);
    }
    
    private RecordMatcher a_record() {
        return MagicJavaBeanMatcher.matching(TypedKeywordRecord.class).using(RecordMatcher.class);