Index: trunk/test/unit/org/CustomMatchers.java
===================================================================
--- trunk/test/unit/org/CustomMatchers.java	(revision 6533)
+++ trunk/test/unit/org/CustomMatchers.java	(revision 6533)
@@ -0,0 +1,55 @@
+package org;
+
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
+import org.openstreetmap.josm.tools.Predicate;
+
+import java.util.Collection;
+
+public class CustomMatchers {
+
+    public static <T> Matcher<? extends T> forPredicate(final Predicate<T> predicate) {
+        return new TypeSafeMatcher<T>() {
+
+            @Override
+            protected boolean matchesSafely(T item) {
+                return predicate.evaluate(item);
+            }
+
+            @Override
+            public void describeTo(Description description) {
+                description.appendValue(predicate);
+            }
+        };
+    }
+
+    public static Matcher<Collection<?>> hasSize(final int size) {
+        return new TypeSafeMatcher<Collection<?>>() {
+            @Override
+            protected boolean matchesSafely(Collection<?> collection) {
+                return collection != null && collection.size() == size;
+            }
+
+            @Override
+            public void describeTo(Description description) {
+                description.appendText("hasSize(").appendValue(size).appendText(")");
+            }
+        };
+    }
+
+    public static Matcher<Collection<?>> isEmpty() {
+        return new TypeSafeMatcher<Collection<?>>() {
+            @Override
+            protected boolean matchesSafely(Collection<?> collection) {
+                return collection != null && collection.isEmpty();
+            }
+
+            @Override
+            public void describeTo(Description description) {
+                description.appendText("isEmpty()");
+            }
+        };
+    }
+
+}
Index: trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java	(revision 6513)
+++ trunk/test/unit/org/openstreetmap/josm/data/validation/tests/OpeningHourTestTest.java	(revision 6533)
@@ -5,10 +5,12 @@
 import org.junit.Test;
 import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.data.Preferences;
 import org.openstreetmap.josm.data.validation.Severity;
 
 import java.util.List;
 
+import static org.CustomMatchers.hasSize;
+import static org.CustomMatchers.isEmpty;
 import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.not;
 import static org.junit.Assert.assertThat;
 
@@ -30,8 +32,11 @@
         final String key = "opening_hours";
         // frequently used tags according to http://taginfo.openstreetmap.org/keys/opening_hours#values
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "24/7").isEmpty(), is(true));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 08:30-20:00").isEmpty(), is(true));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "09:00-21:00").isEmpty(), is(true));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise").isEmpty(), is(true));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "24/7"), isEmpty());
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 08:30-20:00"), isEmpty());
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "09:00-21:00"), isEmpty());
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00,04:00-sunrise; Fr-Sa sunset-sunrise"), isEmpty());
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise"), hasSize(1));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise").get(0).getSeverity(), is(Severity.OTHER));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su-Th sunset-24:00, 04:00-sunrise; Fr-Sa sunset-sunrise").get(0).getPrettifiedValue(), is("Su-Th sunset-24:00,04:00-sunrise; Fr-Sa sunset-sunrise"));
     }
 
@@ -40,5 +45,5 @@
         final String key = "opening_hours";
         final List<OpeningHourTest.OpeningHoursTestError> errors = OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Tue");
-        assertThat(errors.size(), is(1));
+        assertThat(errors, hasSize(1));
         assertThat(errors.get(0).getMessage(), is("Mo-Tue <--- (Please use the abbreviation \"Tu\" for \"tue\".)"));
         assertThat(errors.get(0).getSeverity(), is(Severity.WARNING));
@@ -49,5 +54,5 @@
         final String key = "opening_hours";
         final List<OpeningHourTest.OpeningHoursTestError> errors = OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Sa-Su 10.00-20.00");
-        assertThat(errors.size(), is(2));
+        assertThat(errors, hasSize(2));
         assertThat(errors.get(0).getMessage(), is("Sa-Su 10. <--- (Please use \":\" as hour/minute-separator)"));
         assertThat(errors.get(0).getSeverity(), is(Severity.WARNING));
@@ -59,7 +64,7 @@
     @Test
     public void testCheckOpeningHourSyntax4() throws Exception {
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(null, null).isEmpty(), is(true));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(null, "").isEmpty(), is(true));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(null, " ").isEmpty(), is(true));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(null, null), isEmpty());
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(null, ""), isEmpty());
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(null, " "), isEmpty());
     }
 
@@ -67,8 +72,8 @@
     public void testCheckOpeningHourSyntax5() throws Exception {
         final String key = "opening_hours";
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "badtext").size(), is(1));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "badtext"), hasSize(1));
         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "badtext").get(0).getMessage(),
                 is("opening_hours - ba <--- (Unexpected token: \"b\" This means that the syntax is not valid at that point or it is currently not supported.)"));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "5.00 p.m-11.00 p.m").size(), is(1));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "5.00 p.m-11.00 p.m"), hasSize(1));
         assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "5.00 p.m-11.00 p.m").get(0).getMessage(),
                 is("opening_hours - 5.00 p <--- (hyphen (-) or open end (+) in time range expected. For working with points in time, the mode for opening_hours.js has to be altered. Maybe wrong tag?)"));
@@ -78,5 +83,13 @@
     public void testCheckOpeningHourSyntax6() throws Exception {
         final String key = "opening_hours";
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "PH open \"always open on public holidays\"").isEmpty(), is(true));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "PH open \"always open on public holidays\""), isEmpty());
+    }
+
+    @Test
+    public void testCheckOpeningHourSyntax7() throws Exception {
+        final String key = "opening_hours";
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "9:00-18:00"), hasSize(1));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "9:00-18:00").get(0).getSeverity(), is(Severity.OTHER));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "9:00-18:00").get(0).getPrettifiedValue(), is("09:00-18:00"));
     }
 
@@ -93,9 +106,12 @@
         final String key = "service_times";
         // frequently used tags according to http://taginfo.openstreetmap.org/keys/service_times#values
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su 10:00", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(true));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "automatic", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(false));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Sa 09:00-18:00", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(true));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su 09:30; We 19:30", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(true));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(true));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su 10:00", OpeningHourTest.CheckMode.BOTH), isEmpty());
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "automatic", OpeningHourTest.CheckMode.BOTH), not(isEmpty()));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Sa 09:00-18:00", OpeningHourTest.CheckMode.BOTH), isEmpty());
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Su 09:30; We 19:30", OpeningHourTest.CheckMode.BOTH), isEmpty());
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00", OpeningHourTest.CheckMode.BOTH), isEmpty());
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", OpeningHourTest.CheckMode.BOTH), hasSize(1));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00"));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 0:00-0:30,4:00-00:30; Sa,Su,PH 0:00-24:00", OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 00:00-00:30,04:00-00:30; Sa,Su,PH 00:00-24:00"));
     }
 
@@ -104,8 +120,11 @@
         final String key = "collection_times";
         // frequently used tags according to http://taginfo.openstreetmap.org/keys/collection_times#values
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Sa 09:00", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(true));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "fixme", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(false));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "daily", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(false));
-        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH).isEmpty(), is(true));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Sa 09:00", OpeningHourTest.CheckMode.BOTH), isEmpty());
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "fixme", OpeningHourTest.CheckMode.BOTH), not(isEmpty()));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "daily", OpeningHourTest.CheckMode.BOTH), not(isEmpty()));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30,17:45,19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH), isEmpty());
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH), hasSize(1));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH).get(0).getSeverity(), is(Severity.OTHER));
+        assertThat(OPENING_HOUR_TEST.checkOpeningHourSyntax(key, "Mo-Fr 13:30, 17:45, 19:00; Sa 15:00; Su 11:00", OpeningHourTest.CheckMode.BOTH).get(0).getPrettifiedValue(), is("Mo-Fr 13:30,17:45,19:00; Sa 15:00; Su 11:00"));
     }
 }
