@Test
public void testSetClasses() {

  GiraphConfiguration conf = new GiraphConfiguration();
  conf.setClasses("foo", If.class, A.class, B.class);
  Class<?>[] klasses = conf.getClasses("foo");
  assertEquals(2, klasses.length);
  assertEquals(A.class, klasses[0]);
  assertEquals(B.class, klasses[1]);
  try {
    conf.setClasses("foo", A.class, B.class);
    fail();
  } catch (RuntimeException e) {
    assertEquals(2, conf.getClasses("foo").length);
  }
  Class<? extends If>[] klasses2 = getClassesOfType(conf, "foo", If.class);
  assertEquals(2, klasses2.length);
  assertEquals(A.class, klasses2[0]);
  assertEquals(B.class, klasses2[1]);
}