ProcessIdSegment implements Segment { @Override public boolean validateToken(final String token) { return pid.equals(token); } ProcessIdSegment(); @Override String getStaticText(); @Override boolean validateToken(final String token); @Override String createToken(final String prefix, final Timestamp timestamp);  }
@Test public void validateValidToken() { ProcessIdSegment segment = new ProcessIdSegment(); assertThat(segment.validateToken(PROCESS_ID)).isTrue(); }
@Test public void validateInvalidToken() { String otherId = Long.toString(RuntimeProvider.getProcessId() + 1L); ProcessIdSegment segment = new ProcessIdSegment(); assertThat(segment.validateToken(otherId)).isFalse(); }