### Question:
TypeDeclaration { public Optional<MethodDeclaration> getMethodDeclaration( String name, List<TypeDeclaration> parameterTypeDeclarations) { return getMethodDeclarationInternal(name, parameterTypeDeclarations, false); } protected  TypeDeclaration(
      Context ctx,
      TypeMirror type,
      CtType ctType,
      TypeElement typeElement,
      Map<Name, List<TypeParameterDeclaration>> typeParameterDeclarationsMap); TypeMirror getType(); String getBinaryName(); boolean isUnknownType(); boolean isNullType(); boolean isBooleanType(); boolean isTextType(); boolean isNumberType(); boolean is(Class<?> clazz); boolean isScalarType(); boolean isScalarIterableType(); boolean isScalarArrayType(); List<TypeParameterDeclaration> getTypeParameterDeclarations(); Optional<ConstructorDeclaration> getConstructorDeclaration(
      List<TypeDeclaration> parameterTypeDeclarations); Optional<FieldDeclaration> getFieldDeclaration(String name); Optional<FieldDeclaration> getStaticFieldDeclaration(String name); Optional<MethodDeclaration> getMethodDeclaration(
      String name, List<TypeDeclaration> parameterTypeDeclarations); Optional<MethodDeclaration> getStaticMethodDeclaration(
      String name, List<TypeDeclaration> parameterTypeDeclarations); TypeDeclaration emulateConcatOperation(TypeDeclaration other); TypeDeclaration emulateArithmeticOperation(TypeDeclaration other); boolean isSameType(TypeDeclaration other); @Override String toString();  }### Answer:
@Test void getMethodDeclaration() { Class<?> testClass = getClass(); addProcessor( new TestProcessor() { @Override protected void run() { TypeDeclaration typeDeclaration = ctx.getDeclarations().newTypeDeclaration(testClass); TypeDeclaration parameterDeclaration = ctx.getDeclarations().newTypeDeclaration(Integer.class); Optional<MethodDeclaration> methodDeclaration = typeDeclaration.getMethodDeclaration( "myMethod", Collections.singletonList(parameterDeclaration)); assertTrue(methodDeclaration.isPresent()); MethodDeclaration m = methodDeclaration.get(); assertEquals("myMethod", m.getElement().getSimpleName().toString()); TypeDeclaration returnTypeDeclaration = m.getReturnTypeDeclaration(); assertTrue(returnTypeDeclaration.is(String.class)); } }, new TestProcessor() { @Override protected void run() { TypeDeclaration typeDeclaration = ctx.getDeclarations().newTypeDeclaration(testClass); TypeDeclaration parameterDeclaration = ctx.getDeclarations().newTypeDeclaration(Integer.class); Optional<MethodDeclaration> methodDeclaration = typeDeclaration.getMethodDeclaration( "noSuchMethod", Collections.singletonList(parameterDeclaration)); assertFalse(methodDeclaration.isPresent()); } }); }