Example #1
0
 private Object helper(Class type) {
   KeyFactory.Generator gen = new KeyFactory.Generator();
   gen.setInterface(type);
   gen.setHashConstant(5);
   gen.setHashMultiplier(3);
   return gen.create();
 }
Example #2
0
 public void testNested() throws Exception {
   KeyFactory.Generator gen = new KeyFactory.Generator();
   gen.setInterface(MyKey2.class);
   gen.setHashConstant(17);
   gen.setHashMultiplier(37);
   MyKey2 mykey2 = (MyKey2) gen.create();
   Object instance = mykey2.newInstance(new int[][] {{1, 2}, {3, 4}});
   assertTrue(instance.hashCode() == 31914243);
 }