Method extends JavaElement { public void setReturnType(FullyQualifiedJavaType returnType) { this.returnType = returnType; } Method(String name);  Method(Method original); List<String> getBodyLines(); void addBodyLine(String line); void addBodyLine(int index, String line); void addBodyLines(Collection<String> lines); void addBodyLines(int index, Collection<String> lines); boolean isConstructor(); void setConstructor(boolean constructor); String getName(); void setName(String name); List<TypeParameter> getTypeParameters(); void addTypeParameter(TypeParameter typeParameter); void addTypeParameter(int index, TypeParameter typeParameter); List<Parameter> getParameters(); void addParameter(Parameter parameter); void addParameter(int index, Parameter parameter); Optional<FullyQualifiedJavaType> getReturnType(); void setReturnType(FullyQualifiedJavaType returnType); List<FullyQualifiedJavaType> getExceptions(); void addException(FullyQualifiedJavaType exception); boolean isSynchronized(); void setSynchronized(boolean isSynchronized); boolean isNative(); void setNative(boolean isNative); boolean isDefault(); void setDefault(boolean isDefault); boolean isAbstract(); void setAbstract(boolean isAbstract); boolean isFinal(); void setFinal(boolean isFinal);  }
@Test public void testSetReturnType() { Method method = new Method("bar"); assertFalse(method.getReturnType().isPresent()); method.setReturnType(FullyQualifiedJavaType.getIntInstance()); assertEquals(FullyQualifiedJavaType.getIntInstance(), method.getReturnType().get()); }