### Question:
QualityKey { public void withTypeDo(TypeClosure closure) { closure.execute(type); } QualityKey(Type type, Name name); static QualityKey ForTypeAndName(String type, String name); @Override boolean equals(Object o); @Override int hashCode(); void withTypeDo(TypeClosure closure); void withNameDo(NameClosure closure); @Override String toString();  }### Answer:
@Test public void operatesOnClosureWithType() throws Exception { TypeClosure closure = mock(TypeClosure.class); firstKey.withTypeDo(closure); verify(closure).execute(new Type("type")); }