} else if (ENTITYSET_1_4.equals(sourceEntitySet.getName())) {
data = ((Manager) sourceData).getEmployees();
}
if (data.isEmpty()) {
throw new ODataNotFoundException(null);
}
if (targetKeys.isEmpty()) {
return Arrays.asList(data.toArray());
} else {
for (final Object employee : data) {
if (((Employee) employee).getId().equals(targetKeys.get("EmployeeId"))) {
return employee;
}
}
}
throw new ODataNotFoundException(ODataNotFoundException.ENTITY);
} else if (ENTITYSET_1_2.equals(targetEntitySet.getName())) {
if (((Employee) sourceData).getTeam() == null) {
throw new ODataNotFoundException(ODataNotFoundException.ENTITY);
} else {
return ((Employee) sourceData).getTeam();
}
} else if (ENTITYSET_1_3.equals(targetEntitySet.getName())) {
if (ENTITYSET_1_1.equals(sourceEntitySet.getName())) {
if (((Employee) sourceData).getRoom() == null) {
throw new ODataNotFoundException(ODataNotFoundException.ENTITY);
} else {
return ((Employee) sourceData).getRoom();
}
} else if (ENTITYSET_1_5.equals(sourceEntitySet.getName())) {
List<Room> data = ((Building) sourceData).getRooms();
if (data.isEmpty()) {
throw new ODataNotFoundException(null);
}
if (targetKeys.isEmpty()) {
return Arrays.asList(data.toArray());
} else {
for (final Object room : data) {
if (((Room) room).getId().equals(targetKeys.get("Id"))) {
return room;
}
}
}
throw new ODataNotFoundException(ODataNotFoundException.ENTITY);
}
throw new ODataNotImplementedException();
} else if (ENTITYSET_1_4.equals(targetEntitySet.getName())) {
if (((Employee) sourceData).getManager() == null) {
throw new ODataNotFoundException(ODataNotFoundException.ENTITY);
} else {
return ((Employee) sourceData).getManager();
}
} else if (ENTITYSET_1_5.equals(targetEntitySet.getName())) {
if (((Room) sourceData).getBuilding() == null) {
throw new ODataNotFoundException(ODataNotFoundException.ENTITY);
} else {
return ((Room) sourceData).getBuilding();
}
} else {