RecoveredVariantFactory implements AutoCloseable { @Nullable static String mateLocation(@NotNull final String alt) { final String bracket; if (alt.contains("[")) { bracket = "\\["; } else if (alt.contains("]")) { bracket = "]"; } else { return null; } String[] results = alt.split(bracket); for (String result : results) { if (result.contains(":")) { return result; } } return null; } RecoveredVariantFactory(@NotNull final PurityAdjuster purityAdjuster, @NotNull final String recoveryVCF); @Override void close();  }
@Test public void testMateLocation() { assertEquals("17:59493156", RecoveredVariantFactory.mateLocation("C[17:59493156[")); assertEquals("17:59493156", RecoveredVariantFactory.mateLocation("]17:59493156]C")); }