@Test public void testConstructorRetainsWeight() { final double weight = 64.0D; WeightedElement<String> weightedElement = new WeightedElement<>("A string", weight); assertEquals(weight, weightedElement.weight()); }
public double weight() { return weight; }
WeightedElement { public double weight() { return weight; } }
WeightedElement { public double weight() { return weight; } WeightedElement(final E element, final double weight); }
WeightedElement { public double weight() { return weight; } WeightedElement(final E element, final double weight); E element(); double weight(); static WeightedElement<T> withDefaultWeight(final T element); @SuppressWarnings("unchecked") static WeightedElement<T> ofNull(); static Object parseValue(WeightedElement element, Function<Object, Object> parse); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
WeightedElement { public double weight() { return weight; } WeightedElement(final E element, final double weight); E element(); double weight(); static WeightedElement<T> withDefaultWeight(final T element); @SuppressWarnings("unchecked") static WeightedElement<T> ofNull(); static Object parseValue(WeightedElement element, Function<Object, Object> parse); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }