@Test
	public void getBillLinesByStudentTest() throws InstanceNotFoundException {

		Calendar cb3 = Calendar.getInstance();
		Booking b3 = new Booking(cb3, familyService.findStudent(0),
				bookingService.findDiningHall(0));

		HashSet<Activity> activityForS = new HashSet<Activity>();
		HashSet<Booking> bookingForS = new HashSet<Booking>();
		activityForS.add(activityService.find(0));
		activityForS.add(activityService.find(1));
		bookingForS.add(b3);
		familyService.findStudent(0).setActivities(activityForS);
		familyService.findStudent(0).setBookings(bookingForS);

		familyService.findStudent(1).setActivities(activityForS);

		Household hh = null;
		try {
			hh = familyService.findHousehold(0);
		} catch (InstanceNotFoundException e) {
			fail("Household not found");
		}
		billService.createBill(hh);
		assertEquals(1, hh.getBills().size());

		ArrayList<Bill> ar = new ArrayList<Bill>();
		ar.addAll(hh.getBills());

		HashSet<BillLine> hs = null;
		HashSet<BillLine> hs2 = null;
		try {
			hs = (HashSet<BillLine>) billService.getBillLinesByStudent(
					ar.get(0), familyService.findStudent(0));
			hs2 = (HashSet<BillLine>) billService.getBillLinesByStudent(
					ar.get(0), familyService.findStudent(1));
		} catch (InstanceNotFoundException e1) {
			fail("Student not found");
		}

		Iterator<BillLine> irl = hs.iterator();
		Iterator<BillLine> irl2 = hs2.iterator();
		int count = 0;
		while (irl.hasNext()) {
			count += irl.next().getUnits();
		}
		while (irl2.hasNext()) {
			count += irl2.next().getUnits();
		}

		try {
			//This +2 is because two activities need license.
			assertEquals(familyService.findStudent(0).getActivities().size()
					+ familyService.findStudent(0).getBookings().size()
					+ familyService.findStudent(1).getActivities().size()
					+ familyService.findStudent(1).getBookings().size()+2, count);
		} catch (InstanceNotFoundException e) {
			fail("Student not found");
		}
	}