RsIdParser { public static String parseRsId(String rsField) { String[] rsIds = rsField.split(";"); if (rsIds.length >= 1) { String rsId = rsIds[0]; if (rsId.equals(".")) { return ""; } if (rsId.startsWith("~")) { return rsId.substring(1); } else { return rsId; } } return ""; } private  RsIdParser(); static String parseRsId(String rsField);  }
@Test public void parseRsIdOneRsId() throws Exception { assertThat(RsIdParser.parseRsId("rs12345"), equalTo("rs12345")); }
@Test public void parseRsIdConcatRsId() throws Exception { assertThat(RsIdParser.parseRsId("rs12345;rs54321"), equalTo("rs12345")); }
@Test public void parseRsIdVcfEmptyRsId() throws Exception { assertThat(RsIdParser.parseRsId("."), equalTo("")); }
@Test public void parseRsIdWithTildePrefix() { assertThat(RsIdParser.parseRsId("~rs12345"), equalTo("rs12345")); }
@Test public void parseRsIdReallyEmptyRsId() throws Exception { assertThat(RsIdParser.parseRsId(""), equalTo("")); }