private static double parseWeight(String weightValue) {
      try {
         return Double.parseDouble(weightValue);
      } catch (NumberFormatException nf) {
         throw CONTAINER.invalidWeight(weightValue);
      }
   }
@Test
   public void testParseWeight() {
      MediaType mediaType = MediaType.fromString("application/json; q=0.8");
      assertEquals(0.8, mediaType.getWeight(), 0.0);
   }