SequenceHeaderUtil { public String[] resolveSequenceHeader(final String headerSource) { String[] result = new String[0]; if (headerSource != null) { result = headerSource.split(SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant()); } return result; }  String createSequenceHeader(final String headerSource, final String sequenceId); String[] resolveSequenceHeader(final String headerSource);  }
@Test public void testResolveSequenceHeaderWhenThereIsOneKeyInInput() { String testKey = "TestKey1"; String[] result = underTest.resolveSequenceHeader(testKey); Assert.assertEquals(result.length, 1); Assert.assertEquals(result[0], testKey); }
@Test public void testResolveSequenceHeaderWhenThereAreMoreKeysInInput() { String testKeyFirst = "TestKey1"; String testKeySecond = "TestKey2"; String input = testKeyFirst + SequenceConstants.SEQUENCE_KEY_SEPARATOR.getConstant() + testKeySecond; String[] result = underTest.resolveSequenceHeader(input); Assert.assertEquals(result.length, 2); Assert.assertEquals(result[0], testKeyFirst); Assert.assertEquals(result[1], testKeySecond); }