@Test(expected = ResourceAlreadyExistsException.class)
public void testInsertExistingStudent() throws ResourceAlreadyExistsException {

    Student student1 = new Student(1234, "John Doe", LocalDate.of(2011, Month.JANUARY, 1));
    Student student2 = new Student(1234, "Jane Doe", LocalDate.of(2012, Month.MAY, 1));
    try {
        Student insertedStudent = studentService.insertStudent(student1);
        assertEquals(student1, insertedStudent);
    } catch (ResourceAlreadyExistsException e) {
        e.printStackTrace();
    }
      try {
        Student insertedStudent = studentService.insertStudent(student2);
        assertEquals(student2, insertedStudent);
      } catch (ResourceAlreadyExistsException e) {
          throw e;
      }
}