title: Clean API Design
body: <p>Which would be the better way to design an API:</p>
  
  <pre><code>Example A:
  public class UserService {
    public void addUser(final User user);
    public void addUserToIndex(final User user, final int index);
    public User lookUpUser(final User user);
    public User getUserByIndex(final int index );
    public void removeUser(final User user);
    public List&lt;User&gt; getAllUsers();
  }
  
  Example B:
  public class UserService {
    public void add(final User user);
    public void add(final User user, final int index);
    public User lookUp(final User user);
    public User get(final int index);
    public void remove(final User user);
    public List&lt;User&gt; getAll();
  }
  </code></pre>
  
  <p>Obviously this code will not run - it should just show the problem. I like the second approach more. The method name might be a little bit generic but the context (className, parameter, return Type) makes it pretty clear. One problem which the second approach might have is, what happens if I would need another get method with the same Type. For example, if I want to get a User by their age. Thanks in advance for any help.</p>
  
  <p>kuku</p>