my logic here seems to be wrong. the same sequence for next and previous should not have the same station name. can anyone help me.. :confused:

eg: sequence 555-1, 555-2, 555-3, .....


if (getStation() != null) {
int Seq = getSequence().intValue() - 1;
String stationId = getStationMasterId(station.getId(), (Integer) new Integer(Seq));
if (stationId != null) {
if (getTerminal().getId().equals(stationId)) {
throw new StationMustDifferentWithNextCallException(null);
}
}
}