@Test(expected=BadDataException.class) public void processTooManyCols() throws BadDataException { final RecordProcessor<MfgData> proc = new MfgRecordProcessor(); proc.process(new String[] { "foo", "foo", "foo" }); }
public MfgData process(String[] col) throws BadDataException { if (col.length < 2) { throw new BadDataException("too few columns"); } else if (col.length > 2) { throw new BadDataException("too many columns"); } return new MfgData(col[0], col[1]); }
MfgRecordProcessor implements RecordProcessor<MfgData> { public MfgData process(String[] col) throws BadDataException { if (col.length < 2) { throw new BadDataException("too few columns"); } else if (col.length > 2) { throw new BadDataException("too many columns"); } return new MfgData(col[0], col[1]); } }
MfgRecordProcessor implements RecordProcessor<MfgData> { public MfgData process(String[] col) throws BadDataException { if (col.length < 2) { throw new BadDataException("too few columns"); } else if (col.length > 2) { throw new BadDataException("too many columns"); } return new MfgData(col[0], col[1]); }  }
MfgRecordProcessor implements RecordProcessor<MfgData> { public MfgData process(String[] col) throws BadDataException { if (col.length < 2) { throw new BadDataException("too few columns"); } else if (col.length > 2) { throw new BadDataException("too many columns"); } return new MfgData(col[0], col[1]); }  MfgData process(String[] col); }
MfgRecordProcessor implements RecordProcessor<MfgData> { public MfgData process(String[] col) throws BadDataException { if (col.length < 2) { throw new BadDataException("too few columns"); } else if (col.length > 2) { throw new BadDataException("too many columns"); } return new MfgData(col[0], col[1]); }  MfgData process(String[] col);  }