### Question:
RandomSampler { public static boolean filterBySampleIdOrRandomNumber(@Nullable String sampleIdString, Double ratio) { Long sampleId = null; if (sampleIdString != null) { try { sampleId = Long.valueOf(sampleIdString); } catch (NumberFormatException ignore) { } } return filterBySampleIdOrRandomNumber(sampleId, ratio); }  static boolean filterBySampleIdOrRandomNumber(@Nullable String sampleIdString,
      Double ratio); static boolean filterBySampleIdOrRandomNumber(@Nullable Long sampleId, Double ratio);  }### Answer:
@Test public void filterBySampleIdOrRandomNumber() { assertTrue(RandomSampler.filterBySampleIdOrRandomNumber(0L, 0.01)); assertFalse(RandomSampler.filterBySampleIdOrRandomNumber(1L, 0.01)); assertFalse(RandomSampler.filterBySampleIdOrRandomNumber(99L, 0.01)); assertTrue(RandomSampler.filterBySampleIdOrRandomNumber(0L, 0.05)); assertTrue(RandomSampler.filterBySampleIdOrRandomNumber(4L, 0.05)); assertFalse(RandomSampler.filterBySampleIdOrRandomNumber(5L, 0.05)); assertFalse(RandomSampler.filterBySampleIdOrRandomNumber(99L, 0.05)); assertTrue(RandomSampler.filterBySampleIdOrRandomNumber(99L, 1.0)); assertTrue(RandomSampler.filterBySampleIdOrRandomNumber("0", 0.01)); assertFalse(RandomSampler.filterBySampleIdOrRandomNumber("1", 0.01)); assertFalse(RandomSampler.filterBySampleIdOrRandomNumber("99", 0.01)); assertFalse(RandomSampler.filterBySampleIdOrRandomNumber(-3L, 0.00)); assertFalse(RandomSampler.filterBySampleIdOrRandomNumber(400L, 0.00)); assertFalse(RandomSampler.filterBySampleIdOrRandomNumber("foo", 0.00)); assertFalse(RandomSampler.filterBySampleIdOrRandomNumber((String) null, 0.00)); }