### Question:
FixedWidthConfigurationReader { public FixedWidthConfiguration readFromSasInputDefinition(String encoding, Resource resource, boolean failOnInconsistentLineWidth) { final Map<String, Integer> inputWidthDeclarations = new LinkedHashMap<>(); final Map<String, String> labelDeclarations = new HashMap<>(); resource.read(new Action<InputStream>() { private boolean inInputSection = false; private boolean inLabelSection = false; @Override public void run(InputStream in) throws Exception { try (final BufferedReader reader = new BufferedReader(new InputStreamReader(in))) { for (String line = reader.readLine(); line != null; line = reader.readLine()) { processLine(line); } } } private void processLine(String line) { line = line.trim(); if (line.isEmpty()) { return; } if (";".equals(line)) { inInputSection = false; inLabelSection = false; return; } else if ("INPUT".equals(line)) { inInputSection = true; return; } else if ("LABEL".equals(line)) { inLabelSection = true; return; } if (inInputSection) { final Matcher matcher = PATTERN_SAS_INPUT_LINE.matcher(line); if (matcher.matches()) { final String positionSpec = matcher.group(1); final String nameSpec = matcher.group(2); final int width = Integer.parseInt(matcher.group(3)); logger.debug("Parsed INPUT line \"{}\": position={}, name={}, width={}", line, positionSpec, nameSpec, width); inputWidthDeclarations.put(nameSpec, width); } else { logger.debug("Failed to parse/recognize INPUT line \"{}\"", line); } } else if (inLabelSection) { final Matcher matcher = PATTERN_SAS_LABEL_LINE.matcher(line); if (matcher.matches()) { final String nameSpec = matcher.group(1); final String labelSpec = matcher.group(2); logger.debug("Parsed LABEL line \"{}\": name={}, label={}", line, nameSpec, labelSpec); labelDeclarations.put(nameSpec, labelSpec); } else { logger.debug("Failed to parse/recognize LABEL line \"{}\"", line); } } if (line.endsWith(";")) { inInputSection = false; inLabelSection = false; } } }); final List<FixedWidthColumnSpec> columnSpecs = new ArrayList<>(); for (Entry<String, Integer> entry : inputWidthDeclarations.entrySet()) { final String columnKey = entry.getKey(); final Integer columnWidth = entry.getValue(); final String columnLabel = labelDeclarations.get(columnKey); final String columnName = columnLabel == null ? columnKey : columnLabel; columnSpecs.add(new FixedWidthColumnSpec(columnName, columnWidth)); } return new FixedWidthConfiguration(encoding, columnSpecs, failOnInconsistentLineWidth); }  FixedWidthConfiguration readFromSasFormatFile(String encoding, Resource resource,
            boolean failOnInconsistentLineWidth); FixedWidthConfiguration readFromSasInputDefinition(String encoding, Resource resource,
            boolean failOnInconsistentLineWidth);  }### Answer:
@Test public void testReadConfigurationFromSasInputMetadata() throws Exception { final FixedWidthConfigurationReader reader = new FixedWidthConfigurationReader(); final Resource resource = new FileResource("src/test/resources/metadata_spec1/sas-input-metadata.txt"); assertTrue(resource.isExists()); final FixedWidthConfiguration configuration = reader.readFromSasInputDefinition("UTF8", resource, false); assertEquals("[1, 20, 2]", Arrays.toString(configuration.getValueWidths())); final FixedWidthDataContext dataContext = new FixedWidthDataContext(dataResource, configuration); performAssertionsOnSpec1(dataContext); }