SampleIdentifier { public static SampleIdentifier of(String id, int position) { Objects.requireNonNull(id, "sample id cannot be null"); if (id.isEmpty()) { throw new IllegalArgumentException("sample id cannot be empty"); } return new SampleIdentifier(id, position); } private  SampleIdentifier(String id, int position); static SampleIdentifier of(String id, int position); static SampleIdentifier defaultSample(); String getId(); int getGenotypePosition(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void throwsExceptionWhenInitialisedWithNull() { assertThrows(NullPointerException.class, () -> SampleIdentifier.of(null, 0)); }
@Test public void throwsExceptionWhenInitialisedWithEmptyString() { assertThrows(IllegalArgumentException.class, () -> SampleIdentifier.of("", 0)); }