@Test
	public void testRestoreAndEquals() {
		Map<String, Object> phoneDescription = new HashMap<String, Object>();
		phoneDescription.put("name", "3Gs");
		phoneDescription.put("brandName", "Apple");
		phoneDescription.put("screenSize", 5);
		phoneDescription.put("screenType", ScreenType.RESISTIV);
		phoneDescription.put("version", IOSVersion.IOS4);
		phoneDescription.put("id", firstPhone.getId());
		phoneDescription.put("state", State.BROKEN);

		Map<String, Map<Class<? extends IUser>, Integer>> limitsDescription = new HashMap<String, Map<Class<? extends IUser>, Integer>>();

		Map<Class<? extends IUser>, Integer> copyLimitsForDefaultPhone = new HashMap<Class<? extends IUser>, Integer>();
		copyLimitsForDefaultPhone.put(Student.class, new Integer(2));
		copyLimitsForDefaultPhone.put(Teacher.class, new Integer(10));

		Map<Class<? extends IUser>, Integer> delayLimitsForDefaultPhone = new HashMap<Class<? extends IUser>, Integer>();
		delayLimitsForDefaultPhone.put(Student.class, new Integer(2));
		delayLimitsForDefaultPhone.put(Teacher.class, new Integer(14));

		Map<Class<? extends IUser>, Integer> durationLimitsForDefaultPhone = new HashMap<Class<? extends IUser>, Integer>();
		durationLimitsForDefaultPhone.put(Student.class, new Integer(14));
		durationLimitsForDefaultPhone.put(Teacher.class, new Integer(30));

		limitsDescription.put(Material.KEY_LIMIT_COPY,
				copyLimitsForDefaultPhone);
		limitsDescription.put(Material.KEY_LIMIT_DELAY,
				delayLimitsForDefaultPhone);
		limitsDescription.put(Material.KEY_LIMIT_DURATION,
				durationLimitsForDefaultPhone);

		phoneDescription.put("limits", limitsDescription);

		System.out.println(phoneDescription + "\n" + firstPhone.getDescription());
		
		assertEquals(phoneDescription, firstPhone.getDescription());

		defaultPhone.restore(phoneDescription);

		assertTrue(defaultPhone.equals(firstPhone));
		assertFalse(secondPhone.equals(firstPhone));
		assertFalse(thirdPhone.equals(firstPhone));

		secondPhone.restore(phoneDescription);
		thirdPhone.restore(phoneDescription);

		assertTrue(defaultPhone.equals(thirdPhone));
		assertTrue(firstPhone.equals(thirdPhone));
		assertTrue(secondPhone.equals(thirdPhone));
	}