### Question:
FileBitPatternInfoReader { public List<Long> getFilteredAddresses(ContextRegisterFilter registerFilter) { List<Long> filteredAddresses = new ArrayList<Long>(); for (FunctionBitPatternInfo fInfo : fInfoList) { if (registerFilter.allows(fInfo.getContextRegisters())) { filteredAddresses.add(Long.parseUnsignedLong(fInfo.getAddress(), 16)); } } return filteredAddresses; } FileBitPatternInfoReader(Program program, DataGatheringParams params, Component parent);  FileBitPatternInfoReader(File xmlDir, Component parent);   FileBitPatternInfoReader(File xmlDir); List<Long> getStartingAddresses(); int getNumFuncs(); int getNumFiles(); ContextRegisterExtent getContextRegisterExtent(); List<FunctionBitPatternInfo> getFInfoList(); List<Long> getFilteredAddresses(ContextRegisterFilter registerFilter); DataGatheringParams getDataGatheringParams();  }### Answer:
@Test public void testContextRegisterFiltering() { ContextRegisterFilter cRegFilter = new ContextRegisterFilter(); List<Long> filteredAddresses = fReader.getFilteredAddresses(cRegFilter); assertEquals(TOTAL_NUM_FUNCTIONS, filteredAddresses.size()); cRegFilter.addRegAndValueToFilter("cReg2", new BigInteger("0")); filteredAddresses = fReader.getFilteredAddresses(cRegFilter); assertEquals(TOTAL_NUM_FUNCTIONS / 2, filteredAddresses.size()); cRegFilter.addRegAndValueToFilter("cReg3", new BigInteger("0")); filteredAddresses = fReader.getFilteredAddresses(cRegFilter); assertEquals(TOTAL_NUM_FUNCTIONS / 4, filteredAddresses.size()); Collections.sort(filteredAddresses); assertEquals(0L, (long) filteredAddresses.get(0)); assertEquals(0L, (long) filteredAddresses.get(1)); assertEquals(4L, (long) filteredAddresses.get(2)); assertEquals(4L, (long) filteredAddresses.get(3)); assertEquals(8L, (long) filteredAddresses.get(4)); assertEquals(8L, (long) filteredAddresses.get(5)); assertEquals(12L, (long) filteredAddresses.get(6)); assertEquals(12L, (long) filteredAddresses.get(7)); cRegFilter.addRegAndValueToFilter("cReg4", new BigInteger("1")); filteredAddresses = fReader.getFilteredAddresses(cRegFilter); assertEquals(0, filteredAddresses.size()); }