AnalyzeTracksWorkflowOperationHandler extends AbstractWorkflowOperationHandler { List<Fraction> getAspectRatio(String aspectConfig) { List<Fraction> aspectRatios = new ArrayList<>(); for (String aspect: aspectConfig.split(" *, *")) { if (StringUtils.isNotBlank(aspect)) { aspectRatios.add(Fraction.getFraction(aspect).reduce()); } } return aspectRatios; }  @Override WorkflowOperationResult start(WorkflowInstance workflowInstance, JobContext context);  }
@Test public void testGetAspectRatio() { List<Fraction> a = operationHandler.getAspectRatio("4/3,16/9"); assertEquals(Fraction.getFraction(4, 3), a.get(0)); assertEquals(Fraction.getFraction(16, 9), a.get(1)); assertTrue(operationHandler.getAspectRatio("").isEmpty()); }