Question: I've been writing in Java and C# for a while, but I'm having a hard time identifying places where using a custom annotation would be advantageous.

I can see that JUnit uses annotations in test classes to identify the order it should run the methods in the test classes, which obviates the need for a configuration of some sort. 

What are other examples of problems that annotations solve elegantly?

Answer: 
As others pointed out, annotations are metadata about classes / properties / methods. In general, I find them most useful when data needs to be transformed between the Java domain and another domain or format, such as

* a database (this is what e.g. Hibernate / JPA is dealing with, using annotations heavily)
* an Excel sheet
* a legacy mainframe system

The latter two are real examples from the project I am working on.

Another, related task is data validation. We use the annotations of [Hibernate Validator](http://www.hibernate.org/subprojects/validator.html) (which is an implementation of JSR 303 - Bean Validation) to validate critical pieces of the data received from the above mentioned mainframe, before letting it enter our domain.

As others noted, all the information represented by annotations could in theory be represented in other forms, e.g. in distinct config files (in XML or other format). However, often it is just so much more convenient to have the annotations right there in the code, next to the entity it refers to. Typically (like in the above examples) the metadata represented by annotations is tightly tied to the code. So - once created - it very rarely changes independently of the corresponding code itself. So keeping it physically together with the code makes it cleaner and more maintainable.
Annotations are just metadata, personally I prefer annotations to xml configurations, but don't completely right xml off. My advice use annotations whenthat wouuld make metadata usage more clear and transparent. As an example take a look at JPA annotations, isn't it better to say that your class is an Entity than it is to right an xml file about it and how it relates to other @entities. Annother example Spring MVC @Controllers and @RequestMapping , it's so much easier to find out what the class is and what it does by simply looking at it, not having to go through a pletora of xml files. It is important to note however that too many annotations make the code difficult to read and should be avoided when possible. My advice, go with your gut but always try to make your code readable. 

Hope that helps,  

Peter

P.S. I don't know what Junit does, I have never looked at it's code, but I assume there is some sort of a classpath scanner