WorkArea { public Map<String, Object> parseResults(ByteBuffer buffer) { Map<String, Object> results = new TreeMap<String, Object>(); for (Field field : fields) { String fieldValue = field.read(buffer); if (!fieldValue.isEmpty() && !isFiltered(field)) { results.put(field.getId(), fieldValue); } } return results; } WorkArea(String id, SortedSet<Field> fields);  WorkArea(String id, SortedSet<Field> fields, List<Filter> outputFilters); ByteBuffer createBuffer(Map<String, Object> parameters); ByteBuffer createBuffer(); Map<String, Object> parseResults(ByteBuffer buffer); List<String> getFieldIds(); List<String> getFieldIds(Comparator<Field> comparator, boolean includeFiltered, boolean includeInputFields); int length(); Field findField(String id); String getId(); boolean isFiltered(Field field); @Override String toString();  }
@Test public void testParseResults() { String inputString = "abcdefghijklmnopq"; ByteBuffer buffer = ByteBuffer.allocate(inputString.length()); buffer.put(inputString.getBytes()); Map<String, Object> result = workArea.parseResults(buffer); assertEquals("a", result.get(fieldOne.getId())); assertEquals("bc", result.get(fieldTwo.getId())); assertEquals("def", result.get(fieldThree.getId())); assertEquals("bcdef", result.get(fieldComposite.getId())); }