### Question:
CondenseFillerBytesAnalyzer extends AbstractAnalyzer { String determineFillerValue(Listing listing) { FunctionIterator iterator = listing.getFunctions(true); HashMap<String, Integer> patterns = new HashMap<>(); while (iterator.hasNext()) { Function function = iterator.next(); Address maxAddress = function.getBody().getMaxAddress(); Data undefinedData = listing.getUndefinedDataAt(maxAddress.next()); if (undefinedData == null) { continue; } String pattern = ProgramUtilities.getByteCodeString(undefinedData); if ("??".equals(pattern)) { continue; } if (patterns.containsKey(pattern)) { int value = patterns.get(pattern); patterns.put(pattern, value + 1); } else { patterns.put(pattern, 1); } } if (patterns.isEmpty()) { return null; } String filler = getMostFrequentFillValue(patterns); return filler; } CondenseFillerBytesAnalyzer(); @Override boolean added(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log); @Override boolean removed(Program program, AddressSetView set, TaskMonitor monitor, MessageLog log); @Override void registerOptions(Options options, Program program); @Override void optionsChanged(Options options, Program program);  }### Answer:
@Test public void testDetermineFillerValue_SinglePattern() throws Exception { String fillerPattern = createAndInstallFillerPattern_SinglePattern(); CondenseFillerBytesAnalyzer analyzer = new CondenseFillerBytesAnalyzer(); Listing listing = program.getListing(); String autoFiller = analyzer.determineFillerValue(listing); assertEquals(fillerPattern, autoFiller); }
@Test public void testDetermineFillerValue_TwoPatterns() throws Exception { String fillerPattern = createAndInstallFillerPattern_TwoPatterns(); CondenseFillerBytesAnalyzer analyzer = new CondenseFillerBytesAnalyzer(); Listing listing = program.getListing(); String autoFiller = analyzer.determineFillerValue(listing); assertEquals(fillerPattern, autoFiller); }