HeaderMetaData { public ModelMetaData getPatternsByColumnNumber(final Integer columnIndex) { if (patternsByColumnNumber.containsKey(columnIndex)) { return patternsByColumnNumber.get(columnIndex); } else { throw new IllegalArgumentException("Could not find columnIndex: " + columnIndex); } } HeaderMetaData(@MapsTo("patternsByColumnNumber") final Map<Integer, ModelMetaData> patternsByColumnNumber); ModelMetaData getPatternsByColumnNumber(final Integer columnIndex); int size(); boolean isEmpty(); Set<Integer> keySet();  }
@Test(expected = IllegalArgumentException.class) public void tryToFindAndFail() throws Exception { new HeaderMetaData(new HashMap<>()).getPatternsByColumnNumber(1); }