### Question:
ActorMethodInfoMap { Method get(String methodName) throws NoSuchMethodException { Method method = this.methods.get(methodName); if (method == null) { throw new NoSuchMethodException(String.format("Could not find method %s.", methodName)); } return method; } ActorMethodInfoMap(Collection<Class<?>> interfaceTypes);   }### Answer:
@Test public void normalUsage() { ArrayList<Class<?>> interfaceTypes = new ArrayList<>(); interfaceTypes.add(TestActor.class); ActorMethodInfoMap m = new ActorMethodInfoMap(interfaceTypes); try { Method m1 = m.get("getData"); Assert.assertEquals("getData", m1.getName()); Class c = m1.getReturnType(); Assert.assertEquals(c.getClass(), String.class.getClass()); Parameter[] p = m1.getParameters(); Assert.assertEquals(p[0].getType().getClass(), String.class.getClass()); } catch (Exception e) { Assert.fail("Exception not expected."); } }
@Test(expected = NoSuchMethodException.class) public void lookUpNonExistingMethod() throws NoSuchMethodException { ArrayList<Class<?>> interfaceTypes = new ArrayList<>(); interfaceTypes.add(TestActor.class); ActorMethodInfoMap m = new ActorMethodInfoMap(interfaceTypes); m.get("thisMethodDoesNotExist"); }