ContractRegistry { public boolean hasRegisteredContract(CtClass targetClass) { return targetMap.containsKey(targetClass); } ContractRegistry(); ContractInfo registerContract(CtClass targetClass, CtClass contractClass); ContractInfo getContractInfo(CtClass contractClass); boolean isContractClass(CtClass clazz); boolean hasRegisteredContract(CtClass targetClass); ContractInfo getContractInfoForTargetClass(CtClass targetClass); CtClass getExternalContract(CtClass type, CtClass affectedClass); ListOrderedSet<ContractInfo> getContractsForTypes(ListOrderedSet<CtClass> types, CtClass affectedClass); void registerExternalContract(XmlLocalConfiguration xmlLocalConfiguration); static final ContractRegistry INSTANCE; }
@Test public void testHasRegisteredContract() { assertFalse(contractRegistry.hasRegisteredContract(targetClass)); contractRegistry.registerContract(targetClass, contractClass); assertTrue(contractRegistry.hasRegisteredContract(targetClass)); }