if ( !( obj instanceof Seat ) )
{
continue;
}
Seat seat = ( Seat ) obj;
if ( lastGuest == null )
{
lastGuest = guest4Seat( inList, seat );
}
Guest guest = guest4Seat( inList, seat );
boolean hobbyFound = false;
for ( int i = 0; !hobbyFound && i < lastGuest.getHobbies( ).size( ); i++ )
{
String hobby = ( String ) lastGuest.getHobbies( ).get( i );
if ( guest.getHobbies( ).contains( hobby ) )
{
hobbyFound = true;
}
}
if ( !hobbyFound )
{
throw new RuntimeException( "seat: " + seat.getSeat( )
+ " no common hobby " + lastGuest
+ " -> " + guest );
}
seatCount++;
}