@Test public void basicFailTest() { info1.setValue(two); listToFilter1.add(info1); assertFalse(filter.allows(listToFilter1)); info2.setValue(two); listToFilter2.add(info2); assertTrue(filter.allows(listToFilter2)); listToFilter1.add(info2); assertFalse(filter.allows(listToFilter1)); }
public boolean allows(List<ContextRegisterInfo> contextRegisterInfos) { for (ContextRegisterInfo cInfo : contextRegisterInfos) { if (contextRegisters.contains(cInfo.getContextRegister())) { if (!values.get(cInfo.getContextRegister()).equals(cInfo.getValueAsBigInteger())) { return false; } } } return true; }
ContextRegisterFilter { public boolean allows(List<ContextRegisterInfo> contextRegisterInfos) { for (ContextRegisterInfo cInfo : contextRegisterInfos) { if (contextRegisters.contains(cInfo.getContextRegister())) { if (!values.get(cInfo.getContextRegister()).equals(cInfo.getValueAsBigInteger())) { return false; } } } return true; } }
ContextRegisterFilter { public boolean allows(List<ContextRegisterInfo> contextRegisterInfos) { for (ContextRegisterInfo cInfo : contextRegisterInfos) { if (contextRegisters.contains(cInfo.getContextRegister())) { if (!values.get(cInfo.getContextRegister()).equals(cInfo.getValueAsBigInteger())) { return false; } } } return true; } ContextRegisterFilter(); }
ContextRegisterFilter { public boolean allows(List<ContextRegisterInfo> contextRegisterInfos) { for (ContextRegisterInfo cInfo : contextRegisterInfos) { if (contextRegisters.contains(cInfo.getContextRegister())) { if (!values.get(cInfo.getContextRegister()).equals(cInfo.getValueAsBigInteger())) { return false; } } } return true; } ContextRegisterFilter(); void addRegAndValueToFilter(String contextRegister, BigInteger value); boolean allows(List<ContextRegisterInfo> contextRegisterInfos); @Override String toString(); String getCompactString(); @Override int hashCode(); @Override boolean equals(Object o); Map<String, BigInteger> getValueMap(); }
ContextRegisterFilter { public boolean allows(List<ContextRegisterInfo> contextRegisterInfos) { for (ContextRegisterInfo cInfo : contextRegisterInfos) { if (contextRegisters.contains(cInfo.getContextRegister())) { if (!values.get(cInfo.getContextRegister()).equals(cInfo.getValueAsBigInteger())) { return false; } } } return true; } ContextRegisterFilter(); void addRegAndValueToFilter(String contextRegister, BigInteger value); boolean allows(List<ContextRegisterInfo> contextRegisterInfos); @Override String toString(); String getCompactString(); @Override int hashCode(); @Override boolean equals(Object o); Map<String, BigInteger> getValueMap();  }